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
35 changes: 35 additions & 0 deletions Modules/Core/TestKernel/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,41 @@ if(NOT DO_NOT_BUILD_ITK_TEST_DRIVER)
)

if(NOT DO_NOT_INSTALL_ITK_TEST_DRIVER) # used only by vcpkg
if(
IS_ABSOLUTE
"${ITK_INSTALL_RUNTIME_DIR}"
OR
IS_ABSOLUTE
"${ITK_INSTALL_LIBRARY_DIR}"
)
# ITKModuleMacros assumes relative too, so the install tree is already
# wrong by this point (issue #6896).
message(
FATAL_ERROR
"ITK_INSTALL_RUNTIME_DIR ('${ITK_INSTALL_RUNTIME_DIR}') and ITK_INSTALL_LIBRARY_DIR ('${ITK_INSTALL_LIBRARY_DIR}') must be relative to CMAKE_INSTALL_PREFIX."
)
else()
file(
RELATIVE_PATH
_itk_test_driver_rpath
"${CMAKE_INSTALL_PREFIX}/${ITK_INSTALL_RUNTIME_DIR}"
"${CMAKE_INSTALL_PREFIX}/${ITK_INSTALL_LIBRARY_DIR}"
)
if(APPLE)
set(_itk_test_driver_rpath "@loader_path/${_itk_test_driver_rpath}")
else()
set(_itk_test_driver_rpath "$ORIGIN/${_itk_test_driver_rpath}")
endif()
set_property(
TARGET
itkTestDriver
APPEND
PROPERTY
INSTALL_RPATH
"${_itk_test_driver_rpath}"
)
unset(_itk_test_driver_rpath)
endif()
itk_module_target_install(itkTestDriver)
endif()
endif()
Loading