File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -277,8 +277,14 @@ set(ELASTIX_LIBRARIES elastix_lib transformix_lib PARENT_SCOPE)
277277
278278if (ELASTIX_BUILD_EXECUTABLE AND NOT WIN32 )
279279 # Tell the executables where to find the required .so files.
280- set_target_properties (elastix_exe transformix_exe
281- PROPERTIES INSTALL_RPATH "${CMAKE_INSTALL_PREFIX} /lib:${ITK_DIR} " )
280+ # Supports having the executables in bin, and the .so files in the lib directory next to the bin.
281+ if (APPLE )
282+ set_target_properties (elastix_exe transformix_exe
283+ PROPERTIES BUILD_RPATH "@executable_path/../lib" INSTALL_RPATH "@executable_path/../lib:${CMAKE_INSTALL_PREFIX} /lib:${ITK_DIR} " )
284+ else ()
285+ set_target_properties (elastix_exe transformix_exe
286+ PROPERTIES BUILD_RPATH "\$ ORIGIN/../lib" INSTALL_RPATH "\$ ORIGIN/../lib:${CMAKE_INSTALL_PREFIX} /lib:${ITK_DIR} " )
287+ endif ()
282288endif ()
283289
284290if (ELASTIX_BUILD_EXECUTABLE AND NOT ELASTIX_NO_INSTALL_EXECUTABLES)
You can’t perform that action at this time.
0 commit comments