Merge topic 'fix-FindPackageMode-symlink'

0b86388 CMakeFindPackageMode: fix 32/64bit detection if 'file' is a symlink
This commit is contained in:
David Cole 2012-03-02 11:47:59 -05:00 committed by CMake Topic Stage
commit 0eb520f47c
1 changed files with 2 additions and 1 deletions

View File

@ -71,7 +71,8 @@ if(UNIX)
# 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)
get_filename_component(FILE_ABSPATH "${FILE_EXECUTABLE}" ABSOLUTE)
execute_process(COMMAND "${FILE_ABSPATH}" "${FILE_ABSPATH}" OUTPUT_VARIABLE fileOutput ERROR_QUIET)
if("${fileOutput}" MATCHES "64-bit")
set(CMAKE_SIZEOF_VOID_P 8)
endif()