diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/FindKDE4Internal.cmake | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/modules/FindKDE4Internal.cmake b/modules/FindKDE4Internal.cmake index d71418c1..006cc2d2 100644 --- a/modules/FindKDE4Internal.cmake +++ b/modules/FindKDE4Internal.cmake @@ -994,8 +994,14 @@ if (UNIX) if (APPLE) set(CMAKE_INSTALL_NAME_DIR ${LIB_INSTALL_DIR}) else (APPLE) - # add our LIB_INSTALL_DIR to the RPATH and use the RPATH figured out by cmake when compiling - set(CMAKE_INSTALL_RPATH ${LIB_INSTALL_DIR} ) + # 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("${_isSystemLibDir}" STREQUAL "-1") + set(CMAKE_SKIP_BUILD_RPATH FALSE) set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) |