From f5704eefa1fe97e272db9c74d0dda2c350857cb8 Mon Sep 17 00:00:00 2001 From: "Hans J. Johnson" Date: Tue, 15 Sep 2026 13:55:39 -0500 Subject: [PATCH 1/3] ENH: Request the modules each Video example uses Name the ITK modules behind each example's includes and link targets as find_package COMPONENTS, so configure fails with "No such module" when a module is missing rather than with a missing target at generate time. Link lines are unchanged: each example keeps its explicit ITK::Module targets, which show a reader which module provides which class. Follows the COMPONENTS approach proposed in #470. Co-Authored-By: Bradley Lowekamp --- .../ConvertAnITKGrayScaleImageToCVMat/CMakeLists.txt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Video/BridgeOpenCV/ConvertAnITKGrayScaleImageToCVMat/CMakeLists.txt b/src/Video/BridgeOpenCV/ConvertAnITKGrayScaleImageToCVMat/CMakeLists.txt index c7802c1f3..9b6876a2d 100644 --- a/src/Video/BridgeOpenCV/ConvertAnITKGrayScaleImageToCVMat/CMakeLists.txt +++ b/src/Video/BridgeOpenCV/ConvertAnITKGrayScaleImageToCVMat/CMakeLists.txt @@ -2,7 +2,15 @@ cmake_minimum_required(VERSION 3.22.1) project(ConvertAnITKGrayScaleImageToCVMat) -find_package(ITK REQUIRED) +find_package( + ITK + REQUIRED + COMPONENTS + ITKCommon + ITKIOImageBase + ITKImageIO + ITKVideoBridgeOpenCV +) itk_generate_factory_registration() add_executable(${PROJECT_NAME} Code.cxx) From 3186a5c7861e17210ffd8109af544be938d37760 Mon Sep 17 00:00:00 2001 From: "Hans J. Johnson" Date: Tue, 15 Sep 2026 13:55:48 -0500 Subject: [PATCH 2/3] ENH: Request the modules each Remote example uses Name the ITK modules behind each example's includes and link targets as find_package COMPONENTS, so configure fails with "No such module" when a module is missing rather than with a missing target at generate time. Link lines are unchanged: each example keeps its explicit ITK::Module targets, which show a reader which module provides which class. Follows the COMPONENTS approach proposed in #470. Co-Authored-By: Bradley Lowekamp --- .../CMakeLists.txt | 8 +++++++- src/Remote/WikiExamples/DisplayITKImage/CMakeLists.txt | 10 +++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/Remote/WikiExamples/CustomUserMatrixToAlignImageWithDICOM/CMakeLists.txt b/src/Remote/WikiExamples/CustomUserMatrixToAlignImageWithDICOM/CMakeLists.txt index 8cdf5ff89..08689e288 100644 --- a/src/Remote/WikiExamples/CustomUserMatrixToAlignImageWithDICOM/CMakeLists.txt +++ b/src/Remote/WikiExamples/CustomUserMatrixToAlignImageWithDICOM/CMakeLists.txt @@ -2,7 +2,13 @@ cmake_minimum_required(VERSION 3.22.1) project(CustomUserMatrixToAlignImageWithDICOM) -find_package(ITK REQUIRED) +find_package( + ITK + REQUIRED + COMPONENTS + ITKTestKernel + ITKVtkGlue +) add_executable(${PROJECT_NAME} Code.cxx) target_link_libraries( diff --git a/src/Remote/WikiExamples/DisplayITKImage/CMakeLists.txt b/src/Remote/WikiExamples/DisplayITKImage/CMakeLists.txt index 480999654..d7a4879f8 100644 --- a/src/Remote/WikiExamples/DisplayITKImage/CMakeLists.txt +++ b/src/Remote/WikiExamples/DisplayITKImage/CMakeLists.txt @@ -2,7 +2,15 @@ cmake_minimum_required(VERSION 3.22.1) project(DisplayITKImage) -find_package(ITK REQUIRED) +find_package( + ITK + REQUIRED + COMPONENTS + ITKCommon + ITKIOImageBase + ITKImageIO + ITKVtkGlue +) itk_generate_factory_registration() add_executable(${PROJECT_NAME} Code.cxx) From a74081f66c7f324d3fd6b81db843e8aef8725e1e Mon Sep 17 00:00:00 2001 From: "Hans J. Johnson" Date: Tue, 15 Sep 2026 13:55:58 -0500 Subject: [PATCH 3/3] ENH: Request the modules each Nonunit example uses Name the ITK modules behind each example's includes and link targets as find_package COMPONENTS, so configure fails with "No such module" when a module is missing rather than with a missing target at generate time. Link lines are unchanged: each example keeps its explicit ITK::Module targets, which show a reader which module provides which class. Follows the COMPONENTS approach proposed in #470. Co-Authored-By: Bradley Lowekamp --- .../GeometricPropertiesOfRegion/CMakeLists.txt | 12 +++++++++++- .../CMakeLists.txt | 10 +++++++++- .../CMakeLists.txt | 10 +++++++++- .../CMakeLists.txt | 11 ++++++++++- .../CMakeLists.txt | 11 ++++++++++- 5 files changed, 49 insertions(+), 5 deletions(-) diff --git a/src/Nonunit/Review/GeometricPropertiesOfRegion/CMakeLists.txt b/src/Nonunit/Review/GeometricPropertiesOfRegion/CMakeLists.txt index 20647f128..f3271b59a 100644 --- a/src/Nonunit/Review/GeometricPropertiesOfRegion/CMakeLists.txt +++ b/src/Nonunit/Review/GeometricPropertiesOfRegion/CMakeLists.txt @@ -2,7 +2,17 @@ cmake_minimum_required(VERSION 3.22.1) project(GeometricPropertiesOfRegion) -find_package(ITK REQUIRED) +find_package( + ITK + REQUIRED + COMPONENTS + ITKCommon + ITKIOImageBase + ITKImageFusion + ITKImageIO + ITKImageStatistics + ITKLabelMap +) itk_generate_factory_registration() if(ENABLE_QUICKVIEW) diff --git a/src/Nonunit/Review/MultiphaseChanAndVeseSparseFieldLevelSetSegmentation/CMakeLists.txt b/src/Nonunit/Review/MultiphaseChanAndVeseSparseFieldLevelSetSegmentation/CMakeLists.txt index 21d510956..3f860e89b 100644 --- a/src/Nonunit/Review/MultiphaseChanAndVeseSparseFieldLevelSetSegmentation/CMakeLists.txt +++ b/src/Nonunit/Review/MultiphaseChanAndVeseSparseFieldLevelSetSegmentation/CMakeLists.txt @@ -2,7 +2,15 @@ cmake_minimum_required(VERSION 3.22.1) project(MultiphaseChanAndVeseSparseFieldLevelSetSegmentation) -find_package(ITK REQUIRED) +find_package( + ITK + REQUIRED + COMPONENTS + ITKCommon + ITKIOImageBase + ITKImageIO + ITKReview +) itk_generate_factory_registration() add_executable(${PROJECT_NAME} Code.cxx) diff --git a/src/Nonunit/Review/SegmentBloodVesselsWithMultiScaleHessianBasedMeasure/CMakeLists.txt b/src/Nonunit/Review/SegmentBloodVesselsWithMultiScaleHessianBasedMeasure/CMakeLists.txt index 9a1a7d675..5dffed40c 100644 --- a/src/Nonunit/Review/SegmentBloodVesselsWithMultiScaleHessianBasedMeasure/CMakeLists.txt +++ b/src/Nonunit/Review/SegmentBloodVesselsWithMultiScaleHessianBasedMeasure/CMakeLists.txt @@ -2,7 +2,15 @@ cmake_minimum_required(VERSION 3.22.1) project(SegmentBloodVesselsWithMultiScaleHessianBasedMeasure) -find_package(ITK REQUIRED) +find_package( + ITK + REQUIRED + COMPONENTS + ITKIOImageBase + ITKImageFeature + ITKImageIO + ITKImageIntensity +) itk_generate_factory_registration() add_executable(${PROJECT_NAME} Code.cxx) diff --git a/src/Nonunit/Review/SinglephaseChanAndVeseDenseFieldLevelSetSegmentation/CMakeLists.txt b/src/Nonunit/Review/SinglephaseChanAndVeseDenseFieldLevelSetSegmentation/CMakeLists.txt index ddcd10d07..2705d8e18 100644 --- a/src/Nonunit/Review/SinglephaseChanAndVeseDenseFieldLevelSetSegmentation/CMakeLists.txt +++ b/src/Nonunit/Review/SinglephaseChanAndVeseDenseFieldLevelSetSegmentation/CMakeLists.txt @@ -2,7 +2,16 @@ cmake_minimum_required(VERSION 3.22.1) project(SinglephaseChanAndVeseDenseFieldLevelSetSegmentation) -find_package(ITK REQUIRED) +find_package( + ITK + REQUIRED + COMPONENTS + ITKCommon + ITKFastMarching + ITKIOImageBase + ITKImageIO + ITKReview +) itk_generate_factory_registration() add_executable(${PROJECT_NAME} Code.cxx) diff --git a/src/Nonunit/Review/SinglephaseChanAndVeseSparseFieldLevelSetSegmentation/CMakeLists.txt b/src/Nonunit/Review/SinglephaseChanAndVeseSparseFieldLevelSetSegmentation/CMakeLists.txt index 8429ed7e6..77c126651 100644 --- a/src/Nonunit/Review/SinglephaseChanAndVeseSparseFieldLevelSetSegmentation/CMakeLists.txt +++ b/src/Nonunit/Review/SinglephaseChanAndVeseSparseFieldLevelSetSegmentation/CMakeLists.txt @@ -2,7 +2,16 @@ cmake_minimum_required(VERSION 3.22.1) project(SinglephaseChanAndVeseSparseFieldLevelSetSegmentation) -find_package(ITK REQUIRED) +find_package( + ITK + REQUIRED + COMPONENTS + ITKCommon + ITKFastMarching + ITKIOImageBase + ITKImageIO + ITKReview +) itk_generate_factory_registration() add_executable(${PROJECT_NAME} Code.cxx)