From c20bdffd4362af8511d2d75782ff0019f9fdf184 Mon Sep 17 00:00:00 2001 From: Hans Johnson Date: Sun, 26 Jul 2026 10:33:29 -0500 Subject: [PATCH] COMP: Skip dot-directories when scanning for ITK modules GLOB_RECURSE matches itk-module.cmake at any depth, so a nested source tree under a dot-directory is absorbed as a set of duplicate modules. Dot-directories hold tool state by convention -- git worktrees, editor and agent directories, and environment or cache trees such as the in-source .pixi directory created by ITK's own build tooling -- and .gitignore already declares several of them non-source. One affected tree reported 984 modules where 204 exist, and failed building the stale duplicates. --- CMake/ITKModuleEnablement.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMake/ITKModuleEnablement.cmake b/CMake/ITKModuleEnablement.cmake index 218187f33fe..fefc8a1d32c 100644 --- a/CMake/ITKModuleEnablement.cmake +++ b/CMake/ITKModuleEnablement.cmake @@ -8,6 +8,8 @@ macro(itk_module_load_dag) RELATIVE "${ITK_SOURCE_DIR}" "${ITK_SOURCE_DIR}/*/*/*/itk-module.cmake" # grouped modules ) + # Dot-directories hold tool state (worktrees, environments, caches), not ITK source. + list(FILTER meta EXCLUDE REGEX "(^|/)\\.") foreach(f ${meta}) include(${ITK_SOURCE_DIR}/${f}) list(APPEND ITK_MODULES_ALL ${itk-module})