Skip to content
This repository was archived by the owner on Sep 27, 2024. It is now read-only.

Commit 5964db5

Browse files
committed
Add rpath handling to CMake
1 parent 989a5c1 commit 5964db5

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

CMakeLists.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,27 @@ set(SCAP_WORKBENCH_LINK_LIBRARIES
125125
Qt5::Widgets Qt5::XmlPatterns
126126
${OPENSCAP_LIBRARIES})
127127

128+
# ---------- RPATHS for linking
129+
130+
# see https://cmake.org/Wiki/CMake_RPATH_handling
131+
132+
# use, i.e. don't skip the full RPATH for the build tree
133+
set(CMAKE_SKIP_BUILD_RPATH FALSE)
134+
135+
# when building, don't use the install RPATH already
136+
# (but later on when installing)
137+
set(CMAKE_BUILD_WITH_INSTALL_RPATH ON)
138+
139+
set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR})
140+
141+
# add the automatically determined parts of the RPATH
142+
# which point to directories outside the build tree to the install RPATH
143+
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
144+
145+
# Turn on RPATH for OSX for policy warning
146+
set(CMAKE_MACOSX_RPATH ON)
147+
# ---------- CONFIGURATION
148+
128149
configure_file("include/Config.h.in" "${CMAKE_CURRENT_BINARY_DIR}/Config.h")
129150
# It is not trivial to make the resulting file executable :-(
130151
# People will have to `bash runwrapper.sh ...` in the meantime.

0 commit comments

Comments
 (0)