CMakeFindPackageMode: fix 32/64bit detection if 'file' is a symlink
This commit is contained in:
parent
6a1c5a3569
commit
0b8638821e
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue