diff options
author | Alex Neundorf <neundorf@kde.org> | 2012-02-18 14:44:44 +0100 |
---|---|---|
committer | Alex Neundorf <neundorf@kde.org> | 2012-02-18 14:44:44 +0100 |
commit | 3dea0a0c6be9df8db4d01d6d5dda07c4a6279482 (patch) | |
tree | b8ecd8120bc422a850e6667ad4ce0ee3a10bdbbe /kde-modules/KDECMakeSettings.cmake | |
parent | 2b5f79d9424b09fc2c4294698432255e6c630100 (diff) | |
download | extra-cmake-modules-3dea0a0c6be9df8db4d01d6d5dda07c4a6279482.tar.gz extra-cmake-modules-3dea0a0c6be9df8db4d01d6d5dda07c4a6279482.tar.bz2 |
-add KDECMakeSettings.cmake, move RPATH settings there
Alex
Diffstat (limited to 'kde-modules/KDECMakeSettings.cmake')
-rw-r--r-- | kde-modules/KDECMakeSettings.cmake | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/kde-modules/KDECMakeSettings.cmake b/kde-modules/KDECMakeSettings.cmake new file mode 100644 index 00000000..c6a7b93d --- /dev/null +++ b/kde-modules/KDECMakeSettings.cmake @@ -0,0 +1,41 @@ +# KDE_SKIP_RPATH_SETTINGS + + +################# RPATH handling ################################## + +if(NOT KDE_SKIP_RPATH_SETTINGS) + + if(NOT LIB_INSTALL_DIR) + message(FATAL_ERROR "LIB_INSTALL_DIR not set. This is necessary for using the RPATH settings.") + endif() + + # setup default RPATH/install_name handling, may be overridden by KDE4_HANDLE_RPATH_FOR_EXECUTABLE + # It sets up to build with full RPATH. When installing, RPATH will be changed to the LIB_INSTALL_DIR + # and all link directories which are not inside the current build dir. + if (UNIX) + # the rest is RPATH handling + # here the defaults are set + # which are partly overwritten in kde4_handle_rpath_for_library() + # and kde4_handle_rpath_for_executable(), both located in KDE4Macros.cmake, Alex + if (APPLE) + set(CMAKE_INSTALL_NAME_DIR ${LIB_INSTALL_DIR}) + else () + # add our LIB_INSTALL_DIR to the RPATH (but only when it is not one of the standard system link + # directories listed in CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES) and use the RPATH figured out by cmake when compiling + + list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${LIB_INSTALL_DIR}" _isSystemLibDir) + if("${_isSystemLibDir}" STREQUAL "-1") + set(CMAKE_INSTALL_RPATH "${LIB_INSTALL_DIR}") + endif() + + set(CMAKE_SKIP_BUILD_RPATH FALSE) + set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) + set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) + endif () + endif (UNIX) + +endif() + +################################################################### + + |