aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kde-modules/KDECMakeSettings.cmake17
1 files changed, 11 insertions, 6 deletions
diff --git a/kde-modules/KDECMakeSettings.cmake b/kde-modules/KDECMakeSettings.cmake
index 4f765ae8..9e149667 100644
--- a/kde-modules/KDECMakeSettings.cmake
+++ b/kde-modules/KDECMakeSettings.cmake
@@ -12,6 +12,11 @@ if(NOT KDE_SKIP_RPATH_SETTINGS)
message(FATAL_ERROR "LIB_INSTALL_DIR not set. This is necessary for using the RPATH settings.")
endif()
+ set(_abs_LIB_INSTALL_DIR "${LIB_INSTALL_DIR}")
+ if (NOT IS_ABSOLUTE "${_abs_LIB_INSTALL_DIR}")
+ set(_abs_LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}")
+ 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.
@@ -21,16 +26,16 @@ if(NOT KDE_SKIP_RPATH_SETTINGS)
# 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})
+ set(CMAKE_INSTALL_NAME_DIR ${_abs_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)
- list(FIND CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "${LIB_INSTALL_DIR}" _isSystemCxxLibDir)
- list(FIND CMAKE_C_IMPLICIT_LINK_DIRECTORIES "${LIB_INSTALL_DIR}" _isSystemCLibDir)
- if("${_isSystemPlatformLibDir}" STREQUAL "-1" AND "${_isSystemCxxLibDir}" STREQUAL "-1" AND "${_isSystemCLibDir}" STREQUAL "-1")
- set(CMAKE_INSTALL_RPATH "${LIB_INSTALL_DIR}")
+ list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${_abs_LIB_INSTALL_DIR}" _isSystemLibDir)
+ list(FIND CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "${_abs_LIB_INSTALL_DIR}" _isSystemCxxLibDir)
+ list(FIND CMAKE_C_IMPLICIT_LINK_DIRECTORIES "${_abs_LIB_INSTALL_DIR}" _isSystemCLibDir)
+ if("${_isSystemLibDir}" STREQUAL "-1" AND "${_isSystemCxxLibDir}" STREQUAL "-1" AND "${_isSystemCLibDir}" STREQUAL "-1")
+ set(CMAKE_INSTALL_RPATH "${_abs_LIB_INSTALL_DIR}")
endif()
set(CMAKE_SKIP_BUILD_RPATH FALSE)