Skip to content

Commit

Permalink
Fix rpaths on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanwbrei committed Jan 29, 2025
1 parent 1d4de6a commit 8ed8ee9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
8 changes: 0 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,6 @@ 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
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_USE_LINK_PATH TRUE )

# Generate a compilation database, e.g. for IDE autocompletion
set( CMAKE_EXPORT_COMPILE_COMMANDS TRUE )

Expand Down
7 changes: 7 additions & 0 deletions src/programs/jana/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,12 @@ add_executable(jana jana.cc )
find_package(Threads REQUIRED)
target_link_libraries(jana jana2_shared_lib)
target_link_options(jana PRIVATE -rdynamic)

set_target_properties(jana PROPERTIES
SKIP_BUILD_RPATH FALSE
BUILD_WITH_INSTALL_RPATH FALSE
INSTALL_RPATH_USE_LINK_PATH TRUE
INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib;${CMAKE_INSTALL_PREFIX}/lib/JANA/plugins")

install(TARGETS jana DESTINATION bin)

0 comments on commit 8ed8ee9

Please sign in to comment.