Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions Core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,14 @@ set(ELASTIX_LIBRARIES elastix_lib transformix_lib PARENT_SCOPE)

if(ELASTIX_BUILD_EXECUTABLE AND NOT WIN32)
# Tell the executables where to find the required .so files.
set_target_properties(elastix_exe transformix_exe
PROPERTIES INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib:${ITK_DIR}")
# Supports having the executables in bin, and the .so files in the lib directory next to the bin.
if (APPLE)
set_target_properties(elastix_exe transformix_exe
PROPERTIES BUILD_RPATH "@executable_path/../lib" INSTALL_RPATH "@executable_path/../lib:${CMAKE_INSTALL_PREFIX}/lib:${ITK_DIR}")
else()
set_target_properties(elastix_exe transformix_exe
PROPERTIES BUILD_RPATH "\$ORIGIN/../lib" INSTALL_RPATH "\$ORIGIN/../lib:${CMAKE_INSTALL_PREFIX}/lib:${ITK_DIR}")
endif()
endif()

if(ELASTIX_BUILD_EXECUTABLE AND NOT ELASTIX_NO_INSTALL_EXECUTABLES)
Expand Down