diff options
author | Alexander Neundorf <neundorf@kde.org> | 2008-01-02 21:52:12 (GMT) |
---|---|---|
committer | Alexander Neundorf <neundorf@kde.org> | 2008-01-02 21:52:12 (GMT) |
commit | 474629568c8b96b3883589a5dec8bba3cb0d53e0 (patch) | |
tree | 6bc637090b7e4e3bdbeda6ae06da205bc995cd72 /Modules/CMakeFindBinUtils.cmake | |
parent | 7b54af713dd9ab72335dabb161afba8cd2cc4cc8 (diff) | |
download | CMake-474629568c8b96b3883589a5dec8bba3cb0d53e0.zip CMake-474629568c8b96b3883589a5dec8bba3cb0d53e0.tar.gz CMake-474629568c8b96b3883589a5dec8bba3cb0d53e0.tar.bz2 |
ENH: check the magic code of the executable file to determine the executable
file format. Tested for ELF on x86 Linux, COFF and Mach-O prepared but
commented out since I don't have such systems available. Please have a look
a CMakeDetermineCompilerId.cmake and enable the test for them too.
Only add the option for using chrpath if the executable format is ELF
Alex
Diffstat (limited to 'Modules/CMakeFindBinUtils.cmake')
-rw-r--r-- | Modules/CMakeFindBinUtils.cmake | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Modules/CMakeFindBinUtils.cmake b/Modules/CMakeFindBinUtils.cmake index af48ffd..688d5d8 100644 --- a/Modules/CMakeFindBinUtils.cmake +++ b/Modules/CMakeFindBinUtils.cmake @@ -75,13 +75,13 @@ IF(APPLE) MARK_AS_ADVANCED(CMAKE_INSTALL_NAME_TOOL) ENDIF(APPLE) -IF(UNIX AND NOT APPLE AND NOT WIN32) +# if we are on an ELF system, search for chrpath +IF("${CMAKE_EXECUTABLE_FORMAT}" STREQUAL "ELF") # on ELF platforms there might be chrpath, which works similar to install_name_tool - SET(CMAKE_USE_CHRPATH OFF CACHE BOOL "Enable this to use chrpath if available") + OPTION(CMAKE_USE_CHRPATH "Enable this to use chrpath if available" OFF) FIND_PROGRAM(CMAKE_CHRPATH chrpath PATHS ${_CMAKE_TOOLCHAIN_LOCATION} NO_DEFAULT_PATH) FIND_PROGRAM(CMAKE_CHRPATH chrpath) MARK_AS_ADVANCED(CMAKE_CHRPATH) -ENDIF(UNIX AND NOT APPLE AND NOT WIN32) - +ENDIF("${CMAKE_EXECUTABLE_FORMAT}" STREQUAL "ELF") |