From 867c69910a452bf9016025cacfcaadbf39c6e09b Mon Sep 17 00:00:00 2001 From: "Hans J. Johnson" Date: Tue, 5 May 2026 11:32:20 -0500 Subject: [PATCH] COMP: Drop dead cmake_minimum_required + standalone wrapper from ingests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Four already-merged remote-module ingests still carry their upstream-original boilerplate at the top of their module CMakeLists: - cmake_minimum_required(VERSION X.Y.Z) — redundant; ITK's top-level CMakeLists pins a higher minimum. - if(NOT ITK_SOURCE_DIR) ... find_package(ITK) ... else() itk_module_impl() endif() — dead code in-tree because ITK_SOURCE_DIR is always defined. Strip both from: Modules/Filtering/AnisotropicDiffusionLBR Modules/Filtering/Cuberille Modules/Filtering/LabelErodeDilate Modules/Registration/Montage Lines that had effect inside the in-tree else() branch (set(ITK_DIR ${CMAKE_BINARY_DIR}) on AnisotropicDiffusionLBR and Montage) are preserved unconditionally. The other four merged ingests (GenericLabelInterpolator, MGHIO, FastBilateral, MeshNoise) were already cleaned up during their respective ingest PRs. Matches the v4 ingest-pipeline rules now codified in PR #6204 (sanitize-history.py:patch_drop_cmake_minimum_required and :patch_standalone_build_guard); future ingests will not introduce this idiom. --- .../Filtering/AnisotropicDiffusionLBR/CMakeLists.txt | 12 ++---------- Modules/Filtering/Cuberille/CMakeLists.txt | 9 +-------- Modules/Filtering/LabelErodeDilate/CMakeLists.txt | 9 +-------- Modules/Registration/Montage/CMakeLists.txt | 12 ++---------- 4 files changed, 6 insertions(+), 36 deletions(-) diff --git a/Modules/Filtering/AnisotropicDiffusionLBR/CMakeLists.txt b/Modules/Filtering/AnisotropicDiffusionLBR/CMakeLists.txt index b746377e0ab..1d78a2730ba 100644 --- a/Modules/Filtering/AnisotropicDiffusionLBR/CMakeLists.txt +++ b/Modules/Filtering/AnisotropicDiffusionLBR/CMakeLists.txt @@ -1,5 +1,3 @@ -cmake_minimum_required(VERSION 3.16.3) - project( AnisotropicDiffusionLBR VERSION @@ -10,14 +8,8 @@ project( # Header only module, no libraries set(AnisotropicDiffusionLBR_LIBRARIES AnisotropicDiffusionLBR) -if(NOT ITK_SOURCE_DIR) - find_package(ITK 5.1 REQUIRED) - list(APPEND CMAKE_MODULE_PATH ${ITK_CMAKE_DIR}) - include(ITKModuleExternal) -else() - set(ITK_DIR ${CMAKE_BINARY_DIR}) - itk_module_impl() -endif() +set(ITK_DIR ${CMAKE_BINARY_DIR}) +itk_module_impl() # itk_module_examples() is intentionally omitted: the upstream # examples/ directory is not part of the whitelist-based ingest diff --git a/Modules/Filtering/Cuberille/CMakeLists.txt b/Modules/Filtering/Cuberille/CMakeLists.txt index e17b3840ee6..3376d12f8b2 100644 --- a/Modules/Filtering/Cuberille/CMakeLists.txt +++ b/Modules/Filtering/Cuberille/CMakeLists.txt @@ -1,10 +1,3 @@ -cmake_minimum_required(VERSION 3.16.3) project(Cuberille) -if(NOT ITK_SOURCE_DIR) - find_package(ITK 4.10 REQUIRED) - list(APPEND CMAKE_MODULE_PATH ${ITK_CMAKE_DIR}) - include(ITKModuleExternal) -else() - itk_module_impl() -endif() +itk_module_impl() diff --git a/Modules/Filtering/LabelErodeDilate/CMakeLists.txt b/Modules/Filtering/LabelErodeDilate/CMakeLists.txt index f949f15f571..424260f967c 100644 --- a/Modules/Filtering/LabelErodeDilate/CMakeLists.txt +++ b/Modules/Filtering/LabelErodeDilate/CMakeLists.txt @@ -1,10 +1,3 @@ -cmake_minimum_required(VERSION 3.16.3) project(LabelErodeDilate) -if(NOT ITK_SOURCE_DIR) - find_package(ITK REQUIRED) - list(APPEND CMAKE_MODULE_PATH ${ITK_CMAKE_DIR}) - include(ITKModuleExternal) -else() - itk_module_impl() -endif() +itk_module_impl() diff --git a/Modules/Registration/Montage/CMakeLists.txt b/Modules/Registration/Montage/CMakeLists.txt index 7581e951133..58a5e8ba9c9 100644 --- a/Modules/Registration/Montage/CMakeLists.txt +++ b/Modules/Registration/Montage/CMakeLists.txt @@ -1,5 +1,3 @@ -cmake_minimum_required(VERSION 3.16.3) - if(CMAKE_CXX_STANDARD EQUAL "98") message( FATAL_ERROR @@ -33,13 +31,7 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") endif() endif() -if(NOT ITK_SOURCE_DIR) - find_package(ITK REQUIRED) - list(APPEND CMAKE_MODULE_PATH ${ITK_CMAKE_DIR}) - include(ITKModuleExternal) -else() - set(ITK_DIR ${CMAKE_BINARY_DIR}) - itk_module_impl() -endif() +set(ITK_DIR ${CMAKE_BINARY_DIR}) +itk_module_impl() itk_module_examples()