From ec73595f9dc425957179104d3851b83470c34d42 Mon Sep 17 00:00:00 2001 From: Axel Garcia Date: Wed, 29 Jul 2026 10:28:36 +0200 Subject: [PATCH 1/2] ENH: Install targets and propagate CUDAToolkit dependency --- CMakeLists.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 589fe69..e24b739 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -89,6 +89,8 @@ set(CudaCommon_VERSION_STRING ${CudaCommon_VERSION_STRING}) " ) +set(CudaCommon_EXPORT_CODE_INSTALL "find_package(CUDAToolkit REQUIRED)") + if(NOT ITK_SOURCE_DIR) if(NOT EXISTS ${ITK_CMAKE_DIR}/ITKModuleMacros.cmake) message( @@ -108,3 +110,13 @@ install( ${_configuration_header_file} DESTINATION ${CudaCommon_INSTALL_INCLUDE_DIR} ) + +if(NOT ITK_SOURCE_DIR) + # Install the CMake targets export file so that find_package(ITK + # COMPONENTS CudaCommon) can find the CudaCommon imported targets. + install( + EXPORT ${${itk-module}-targets} + DESTINATION "${ITK_INSTALL_PACKAGE_DIR}/Modules/Targets" + COMPONENT Development + ) +endif() From 795be25da9c8669977c84044cde755d8887bb087 Mon Sep 17 00:00:00 2001 From: Simon Rit Date: Fri, 28 Aug 2026 08:20:01 +0200 Subject: [PATCH 2/2] ENH: Add CudaCommon version strings in installed CMake files --- CMakeLists.txt | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e24b739..56b3b87 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -76,12 +76,9 @@ configure_file( ) set( - CudaCommon_EXPORT_CODE_BUILD + CudaCommon_VERSION_STRINGS " -# Pass source dir to allow other modules, e.g. RTK, to use CudaImage.i.init and CudaImage.i.in -set(CudaCommon_SOURCE_DIR ${CudaCommon_SOURCE_DIR}) - -# Also pass CudaCommon version +# CudaCommon version numbers set(CudaCommon_VERSION_MAJOR ${CudaCommon_VERSION_MAJOR}) set(CudaCommon_VERSION_MINOR ${CudaCommon_VERSION_MINOR}) set(CudaCommon_VERSION_PATCH ${CudaCommon_VERSION_PATCH}) @@ -89,7 +86,24 @@ set(CudaCommon_VERSION_STRING ${CudaCommon_VERSION_STRING}) " ) -set(CudaCommon_EXPORT_CODE_INSTALL "find_package(CUDAToolkit REQUIRED)") +set( + CudaCommon_EXPORT_CODE_BUILD + " +# Pass source dir to allow other modules, e.g. RTK, to use CudaImage.i.init and CudaImage.i.in +set(CudaCommon_SOURCE_DIR ${CudaCommon_SOURCE_DIR}) + +${CudaCommon_VERSION_STRINGS} +" +) + +set( + CudaCommon_EXPORT_CODE_INSTALL + " +find_package(CUDAToolkit REQUIRED) + +${CudaCommon_VERSION_STRINGS} +" +) if(NOT ITK_SOURCE_DIR) if(NOT EXISTS ${ITK_CMAKE_DIR}/ITKModuleMacros.cmake)