Use rpaths for linked libraries
parent
a66dcfdb1b
commit
14db470624
|
@ -14,13 +14,15 @@ set(CMAKE_CXX_STANDARD 11)
|
|||
set(CMAKE_CXX_STANDARD_REQUIRED y)
|
||||
set(CMAKE_CXX_EXTENSIONS n)
|
||||
|
||||
# TODO (fix RPATHs)
|
||||
# We have to hack our RPATHs a bit for these shared libraries to be
|
||||
# loaded by others on the install-side. Maybe these libraries should
|
||||
# be combined and/or installed to a common ISCE2 lib directory.
|
||||
# Is there a semantic way to propagate their RPATHs
|
||||
# without using these global variables?
|
||||
include(GNUInstallDirs)
|
||||
|
||||
# add automatically determined parts of the RPATH, which point to directories
|
||||
# outside of the build tree, to the install RPATH
|
||||
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH ON)
|
||||
list(APPEND CMAKE_INSTALL_RPATH
|
||||
${CMAKE_INSTALL_PREFIX}/${ISCE2_PKG}/components/isceobj/Util
|
||||
)
|
||||
|
||||
# the RPATH to be used when installing, but only if it's not a system directory
|
||||
set(abs_libdir ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR})
|
||||
list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES ${abs_libdir} isSystemDir)
|
||||
if("${isSystemDir}" STREQUAL "-1")
|
||||
list(APPEND CMAKE_INSTALL_RPATH ${abs_libdir})
|
||||
endif()
|
||||
|
|
|
@ -130,7 +130,8 @@ target_include_directories(combinedLib INTERFACE
|
|||
install(TARGETS
|
||||
utilLib
|
||||
combinedLib
|
||||
LIBRARY DESTINATION lib)
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
)
|
||||
|
||||
InstallSameDir(
|
||||
combinedlibmodule
|
||||
|
|
Loading…
Reference in New Issue