diff options
author | Alexander Neundorf <neundorf@kde.org> | 2007-12-18 22:50:27 (GMT) |
---|---|---|
committer | Alexander Neundorf <neundorf@kde.org> | 2007-12-18 22:50:27 (GMT) |
commit | 3ae731fab7a3b992c321226262076a2622f64c11 (patch) | |
tree | 223da7b100533710445dde2a52243baff0883452 /Modules | |
parent | f5f397debde141a15225ea52bc2768d723a27375 (diff) | |
download | CMake-3ae731fab7a3b992c321226262076a2622f64c11.zip CMake-3ae731fab7a3b992c321226262076a2622f64c11.tar.gz CMake-3ae731fab7a3b992c321226262076a2622f64c11.tar.bz2 |
ENH: add support for chrpath, so the RPATH in ELF files can be changed when
installing without having to link the target again -> can save a lot of time
chrpath is handled very similar to install_name_tool on the mac. If the
RPATH in the build tree file is to short, it is padded using the separator
character.
This is currently disabled by default, it can be enabled using the option
CMAKE_USE_CHRPATH. There are additional checks whether it is safe to enable
it. I will rework them and use FILE(READ) instead to detect whether the
binaries are actually ELF files.
chrpath is available here
http://www.tux.org/pub/X-Windows/ftp.hungry.com/chrpath/
or kde svn (since a few days): http://websvn.kde.org/trunk/kdesupport/chrpath/
Alex
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/CMakeFindBinUtils.cmake | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Modules/CMakeFindBinUtils.cmake b/Modules/CMakeFindBinUtils.cmake index 2cb7696..43f76f7 100644 --- a/Modules/CMakeFindBinUtils.cmake +++ b/Modules/CMakeFindBinUtils.cmake @@ -75,3 +75,13 @@ IF(APPLE) MARK_AS_ADVANCED(CMAKE_INSTALL_NAME_TOOL) ENDIF(APPLE) +IF(UNIX AND NOT APPLE AND NOT WIN32) + # on ELF platforms there might be chrpath, which works similar to install_name_tool + 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) + |