CMakeFindPackageMode: fix 32/64bit detection if 'file' is a symlink

This commit is contained in:
Yury G. Kudryashov 2012-02-24 01:39:39 +04:00 committed by Brad King
parent 6a1c5a3569
commit 0b8638821e
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()