From 3f2a96a4367229a94dc794f765fc644d833b1d68 Mon Sep 17 00:00:00 2001 From: Hans Johnson Date: Sat, 18 Apr 2026 17:34:55 -0500 Subject: [PATCH] ENH: Add Modules/Beta/ container for inline beta modules Introduces Modules/Beta/ as the in-tree home for modules that were formerly configure-time remote fetches (Modules/Remote/*.remote.cmake). Modules/Beta/CMakeLists.txt defines a no-op itk_beta_module_manifest() function so that provenance files (Modules/Beta/.beta.cmake) are valid CMake and can be include()-d without build-time side effects. Actual modules grafted under Modules/Beta// are discovered via the existing itk-module.cmake DAG scan in ITKModuleEnablement.cmake. No modules are ingested by this commit; this only wires the container. --- CMakeLists.txt | 6 ++++++ Modules/Beta/CMakeLists.txt | 32 ++++++++++++++++++++++++++++++++ Modules/Remote/CMakeLists.txt | 4 ++-- 3 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 Modules/Beta/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index aba2ec14dd4..5ff1a0d28ef 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -741,6 +741,12 @@ endif() # dependencies. add_subdirectory(Modules/Remote) +# In-tree beta modules (formerly remote fetches, now grafted inline). +# Loads provenance manifests (Modules/Beta/*.beta.cmake) and is a no-op +# at build time; the actual modules under Modules/Beta// are +# discovered via the normal itk-module.cmake DAG scan below. +add_subdirectory(Modules/Beta) + # Enable modules according to user inputs and the module dependency DAG. include(ITKModuleEnablement) diff --git a/Modules/Beta/CMakeLists.txt b/Modules/Beta/CMakeLists.txt new file mode 100644 index 00000000000..d24bdd475af --- /dev/null +++ b/Modules/Beta/CMakeLists.txt @@ -0,0 +1,32 @@ +# Modules/Beta/ +# +# In-tree home for modules that were formerly configure-time remote +# fetches (Modules/Remote/*.remote.cmake). Each module lives at +# Modules/Beta// with its own itk-module.cmake and is discovered +# automatically by the normal ITK module DAG scan (see +# CMake/ITKModuleEnablement.cmake). +# +# Alongside each ingested module, an optional manifest +# Modules/Beta/.beta.cmake records upstream provenance +# (UPSTREAM_URL, UPSTREAM_SHA at last ingest, INGEST_DATE, license, +# compliance level). The manifest files are inert at build time -- +# they are passive metadata consumed by tooling and human readers. + +# itk_beta_module_manifest() is a no-op that makes the *.beta.cmake +# files valid CMake so they can be include()-d by tooling without +# producing build-time side effects. +function(itk_beta_module_manifest _name) + # arguments are intentionally discarded; parsed by external tooling. +endfunction() + +# Include every *.beta.cmake so CMake at least syntactically validates +# them at configure time. This does not enable, build, or fetch anything. +# CONFIGURE_DEPENDS asks CMake to re-glob whenever a manifest is added, +# removed, or renamed, so a Beta-module ingest does not require a manual +# `cmake .` reconfigure. +file(GLOB _beta_manifests CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/*.beta.cmake") +foreach(_manifest ${_beta_manifests}) + include(${_manifest}) +endforeach() +unset(_beta_manifests) +unset(_manifest) diff --git a/Modules/Remote/CMakeLists.txt b/Modules/Remote/CMakeLists.txt index 32ac7417435..b3d4618c857 100644 --- a/Modules/Remote/CMakeLists.txt +++ b/Modules/Remote/CMakeLists.txt @@ -16,7 +16,7 @@ set_property( "0") mark_as_advanced(FORCE ITK_MINIMUM_COMPLIANCE_LEVEL) -file(GLOB remotes "*.remote.cmake") +file(GLOB remotes CONFIGURE_DEPENDS "*.remote.cmake") foreach(remote_module ${remotes}) include(${remote_module}) endforeach() @@ -25,7 +25,7 @@ endforeach() # a separate subdirectory to assist with distinguishing # different remote module types. if(Module_ITKDeprecated) - file(GLOB remotes "Deprecated/*.remote.cmake") + file(GLOB remotes CONFIGURE_DEPENDS "Deprecated/*.remote.cmake") foreach(remote_module ${remotes}) include(${remote_module}) endforeach()