ENH: Use builtin chrpath instead of relinking ELF targets

- Add cmSystemTools::ChangeRPath method
  - Add undocumented file(CHRPATH) command
  - When installing use file(CHRPATH) to change the rpath
    instead of relinking
  - Remove CMAKE_CHRPATH lookup from CMakeFindBinUtils
  - Remove CMAKE_USE_CHRPATH option since this should
    always work
This commit is contained in:
Brad King
2008-03-01 12:51:07 -05:00
parent 61178a0682
commit 34c76d4304
10 changed files with 133 additions and 31 deletions
-13
View File
@@ -74,16 +74,3 @@ IF(APPLE)
MARK_AS_ADVANCED(CMAKE_INSTALL_NAME_TOOL)
ENDIF(APPLE)
# if we are on an ELF system, search for chrpath
# according to the binutils mailing list chrpath has problems when cross compiling
# i.e. if the target has different endianness than the host
IF("${CMAKE_EXECUTABLE_FORMAT}" STREQUAL "ELF" AND NOT CMAKE_CROSSCOMPILING)
# 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 CMAKE_USE_CHRPATH)
ENDIF("${CMAKE_EXECUTABLE_FORMAT}" STREQUAL "ELF" AND NOT CMAKE_CROSSCOMPILING)