diff --git a/CMakeLists.txt b/CMakeLists.txt index ed3c448..a0cdb52 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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