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

Commit d10f6f5

Browse files
committed
Clean up rpath for OSX in CMake
1 parent 5964db5 commit d10f6f5

File tree

2 files changed

+15
-16
lines changed

2 files changed

+15
-16
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ compiler:
88
- gcc
99

1010
env:
11-
- PATH="/usr/local/opt/qt:/usr/local/opt/qt/bin:$PATH"
11+
- PATH="/usr/local/opt/qt/bin:$PATH"
1212

1313
before_install:
1414
- brew update
@@ -27,7 +27,7 @@ before_script:
2727
script:
2828
- ./build-for-osx.sh
2929
- wget `curl -s https://api.github.com/repos/openscap/scap-security-guide/releases/latest?access_token=$GITHUB_TOKEN | jq -r ".assets[] | select(.name | test(\"(scap-security-guide-[0-9].[0-9].[0-9]*).zip\")) | .browser_download_url"` -O ssg.zip
30-
- mkdir -p `pwd`/scap-workbench.app/Contents/Resources/ssg/ && unzip ssg.zip -d `pwd`/scap-workbench.app/Contents/Resources/ssg/
30+
- mkdir -p `pwd`/build-osx/scap-workbench.app/Contents/Resources/ssg/ && unzip ssg.zip && cp -a scap-security-guide-*/* `pwd`/build-osx/scap-workbench.app/Contents/Resources/ssg/
3131
- cd build-osx && sh osx-create-dmg.sh
3232

3333
deploy:

CMakeLists.txt

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -127,24 +127,23 @@ set(SCAP_WORKBENCH_LINK_LIBRARIES
127127

128128
# ---------- RPATHS for linking
129129

130-
# see https://cmake.org/Wiki/CMake_RPATH_handling
130+
# see https://gitlab.kitware.com/cmake/community/wikis/doc/cmake/RPATH-handling
131131

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)
132+
if (APPLE)
133+
# when building, use the install RPATH
134+
# (but later on when installing)
135+
set(CMAKE_BUILD_WITH_INSTALL_RPATH ON)
138136

139-
set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR})
137+
set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR})
140138

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)
139+
# add the automatically determined parts of the RPATH
140+
# which point to directories outside the build tree to the install RPATH
141+
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
144142

145-
# Turn on RPATH for OSX for policy warning
146-
set(CMAKE_MACOSX_RPATH ON)
147-
# ---------- CONFIGURATION
143+
# Turn on RPATH for OSX for policy warning
144+
set(CMAKE_MACOSX_RPATH ON)
145+
# ---------- CONFIGURATION
146+
endif()
148147

149148
configure_file("include/Config.h.in" "${CMAKE_CURRENT_BINARY_DIR}/Config.h")
150149
# It is not trivial to make the resulting file executable :-(

0 commit comments

Comments
 (0)