build: provide typical default value for CMAKE_INSTALL_RPATH

This commit is contained in:
Roland Conybeare 2023-09-26 12:32:12 -04:00
commit 5b4d9331c8

View file

@ -12,7 +12,6 @@ include(cmake/code-coverage.cmake)
# unit test setup
enable_testing()
# activate code coverage for all executables + libraries (when configured with -DCODE_COVERAGE=ON)
add_code_coverage()
# 1. assuming that /nix/store/ prefixes .hpp files belonging to gcc, catch2 etc.
@ -39,6 +38,10 @@ set(CMAKE_CXX_STANDARD_REQUIRED True)
# always write compile_commands.json
set(CMAKE_EXPORT_COMPILE_COMMANDS ON CACHE INTERNAL "")
if(NOT CMAKE_INSTALL_RPATH)
set(CMAKE_INSTALL_RPATH $(CMAKE_INSTALL_PREFIX)/lib CACHE STRING "runpath in installed libraries/executables")
endif()
# ----------------------------------------------------------------
# sources