From 1bf617260fe92df8f7a069046998e31ab94f343f Mon Sep 17 00:00:00 2001 From: Nathan Brei Date: Wed, 29 Jan 2025 21:46:04 -0500 Subject: [PATCH] Fix RPATHs on macOS --- CMakeLists.txt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cd83257bc..53bd81269 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,12 +29,10 @@ else() endif() -# Add library directories to rpath so users don't need to use LD_LIBRARY_PATH. -# (see https://dev.my-gate.net/2021/08/04/understanding-rpath-with-cmake ) -# TODO: detector MacOS and set MACOSX_RPATH to TRUE +# Add library directories to RPATH for all targets set( CMAKE_SKIP_BUILD_RPATH FALSE ) set( CMAKE_BUILD_WITH_INSTALL_RPATH FALSE ) -set( CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/JANA/plugins" ) +set( CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib;${CMAKE_INSTALL_PREFIX}/lib/JANA/plugins" ) set( CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE ) # Generate a compilation database, e.g. for IDE autocompletion