Skip to content

Commit

Permalink
set CMAKE_BUILD_WITH_INSTALL_RPATH too
Browse files Browse the repository at this point in the history
  • Loading branch information
ClausKlein committed Apr 5, 2024
1 parent fe86bcb commit 966567d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ set(CMAKE_CXX_STANDARD 20)
# This allows libraries from multiple build types to be put in the same directory without overwriting each other
set(CMAKE_RELWITHDEBINFO_POSTFIX d)

# The install of the my_exe target requires changing an RPATH from the build tree,
# but this is not supported with the Ninja generator unless on an ELF-based or XCOFF-based platform.
set(CMAKE_BUILD_WITH_INSTALL_RPATH ON)

include(FetchContent)
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0")
cmake_policy(SET CMP0135 NEW)
Expand Down
4 changes: 3 additions & 1 deletion CMakeWorkflowPresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
"environment": {
"CPM_USE_LOCAL_PACKAGES": "YES",
"CPM_SOURCE_CACHE": "$env{HOME}/.cache/CPM",
"LD_LIBRARY_PATH":
"${sourceDir}/lib${pathListSep}$env{HOME}/.local/lib${pathListSep}$penv{LD_LIBRARY_PATH}",
"PATH": "$env{HOME}/.local/bin${pathListSep}$penv{PATH}"
}
},
Expand All @@ -52,7 +54,7 @@
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_SKIP_INSTALL_RULES": true,
"BUILD_SHARED_LIBS": true,
"BUILD_SHARED_LIBS": false,
"FEATURE_FUZZ_TESTS": true,
"FEATURE_TESTS": true,
"FEATURE_DOCS": false,
Expand Down

0 comments on commit 966567d

Please sign in to comment.