Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,19 @@ else()
endif()

#
# Use full RPATH
# Specify a relative RPATH to support both configure-time and install-time prefixes.
#
set (CMAKE_SKIP_BUILD_RPATH FALSE)
set (CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
set (CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib)
if(APPLE)
set(CMAKE_INSTALL_RPATH "@loader_path/../lib")
elseif(UNIX)
# [[ ]] keeps $ORIGIN literal for the linker instead of letting CMake expand it.
set(CMAKE_INSTALL_RPATH [[$ORIGIN/../lib]])
else()
# RPATH is not supported for non-ELF platforms. Keep the configure-time default.
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
endif()
set (CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)

#
Expand Down
Loading