[cmake-commits] alex committed CMakeFindBinUtils.cmake 1.8 1.9

cmake-commits at cmake.org cmake-commits at cmake.org
Tue Dec 18 17:50:29 EST 2007


Update of /cvsroot/CMake/CMake/Modules
In directory public:/mounts/ram/cvs-serv3677/Modules

Modified Files:
	CMakeFindBinUtils.cmake 
Log Message:
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


Index: CMakeFindBinUtils.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/CMakeFindBinUtils.cmake,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- CMakeFindBinUtils.cmake	15 Aug 2007 18:26:00 -0000	1.8
+++ CMakeFindBinUtils.cmake	18 Dec 2007 22:50:27 -0000	1.9
@@ -75,3 +75,13 @@
   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)
+



More information about the Cmake-commits mailing list