summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeFindPackageMode.cmake
diff options
context:
space:
mode:
authorYury G. Kudryashov <urkud.urkud@gmail.com>2012-02-23 21:39:39 (GMT)
committerBrad King <brad.king@kitware.com>2012-02-28 17:59:01 (GMT)
commit0b8638821eccd09a50dfb26cfe7a82549c8254c5 (patch)
treefb1fab3b1856561e1b02fef686527440a63ddff0 /Modules/CMakeFindPackageMode.cmake
parent6a1c5a356911d3b75e60ecad86d7538e6de888f9 (diff)
downloadCMake-0b8638821eccd09a50dfb26cfe7a82549c8254c5.zip
CMake-0b8638821eccd09a50dfb26cfe7a82549c8254c5.tar.gz
CMake-0b8638821eccd09a50dfb26cfe7a82549c8254c5.tar.bz2
CMakeFindPackageMode: fix 32/64bit detection if 'file' is a symlink
Diffstat (limited to 'Modules/CMakeFindPackageMode.cmake')
-rw-r--r--Modules/CMakeFindPackageMode.cmake3
1 files changed, 2 insertions, 1 deletions
diff --git a/Modules/CMakeFindPackageMode.cmake b/Modules/CMakeFindPackageMode.cmake
index 4296577..59c7ba5 100644
--- a/Modules/CMakeFindPackageMode.cmake
+++ b/Modules/CMakeFindPackageMode.cmake
@@ -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()