diff options
author | Alex Neundorf <neundorf@kde.org> | 2011-07-18 19:40:45 (GMT) |
---|---|---|
committer | Alex Neundorf <neundorf@kde.org> | 2011-08-09 14:32:45 (GMT) |
commit | b0e357824c0ddf1a57db7742da3d5f3f90af97d2 (patch) | |
tree | 9b993b8e9591af6280032fe4e49f54fe1baaf0e8 /Modules/CMakeFindPackageMode.cmake | |
parent | 53edfb206b549f0dd5a014aac054ca82d865bbcd (diff) | |
download | CMake-b0e357824c0ddf1a57db7742da3d5f3f90af97d2.zip CMake-b0e357824c0ddf1a57db7742da3d5f3f90af97d2.tar.gz CMake-b0e357824c0ddf1a57db7742da3d5f3f90af97d2.tar.bz2 |
Use the file-utility to test for 64bit if there is no /usr/lib64
Alex
Diffstat (limited to 'Modules/CMakeFindPackageMode.cmake')
-rw-r--r-- | Modules/CMakeFindPackageMode.cmake | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/Modules/CMakeFindPackageMode.cmake b/Modules/CMakeFindPackageMode.cmake index bebf3ab..3e5cb49 100644 --- a/Modules/CMakeFindPackageMode.cmake +++ b/Modules/CMakeFindPackageMode.cmake @@ -45,10 +45,18 @@ if(UNIX) # try to guess whether we have a 64bit system, if it has not been set # from the outside if(NOT CMAKE_SIZEOF_VOID_P) + set(CMAKE_SIZEOF_VOID_P 4) if(EXISTS /usr/lib64) set(CMAKE_SIZEOF_VOID_P 8) else() - set(CMAKE_SIZEOF_VOID_P 4) + # use the file utility to check whether itself is 64 bit: + find_program(FILE_EXECUTABLE file) + if(FILE_EXECUTABLE) + execute_process(COMMAND "${FILE_EXECUTABLE}" "${FILE_EXECUTABLE}" OUTPUT_VARIABLE fileOutput ERROR_QUIET) + if("${fileOutput}" MATCHES "64-bit") + set(CMAKE_SIZEOF_VOID_P 8) + endif() + endif() endif() endif() @@ -56,7 +64,6 @@ if(UNIX) if(EXISTS /etc/debian_version) if(NOT CMAKE_${LANGUAGE}_LANGUAGE_ARCHITECTURE ) file(GLOB filesInLib RELATIVE /lib /lib/*-linux-gnu* ) - list(APPEND filesInLib i386-linux-gnu) foreach(file ${filesInLib}) if("${file}" MATCHES "${CMAKE_LIBRARY_ARCHITECTURE_REGEX}") set(CMAKE_${LANGUAGE}_LANGUAGE_ARCHITECTURE ${file}) |