You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ITK's declared cmake_minimum_required is 3.22.1, but Wrapping/macro_files/itk_auto_load_submodules.cmake silently requires CMake ≥ 3.27 since PR #5842 (merged 2026-03-05). Builds with CMake 3.22.1–3.26.x and ITK_WRAP_PYTHON=ON produce castxml input files with empty -I / -isystem / -D flags and fail to find module headers.
Root cause
PR #5842 / commit 7a59c6da41 ("BUG: Use module's interface include in wrapping's castxml") replaced configure-time string(REPLACE …) with generation-time generator expressions in the castxml include-file template. The new template uses three nested $<LIST:JOIN,$<LIST:TRANSFORM,$<TARGET_PROPERTY:…>,REPLACE,…>,\n> constructs at:
The $<LIST:JOIN,…> and $<LIST:TRANSFORM,…> generator expressions were first released in CMake 3.27 (2023-07). The corresponding list(JOIN …) / list(TRANSFORM …)commands have been around since CMake 3.12, which likely caused the version requirement to be overlooked — the generator-expression equivalents are much newer.
On CMake < 3.27, file(GENERATE) evaluates these expressions to empty strings (no diagnostic by default), so the generated *.castxml.inc file has no include flags and castxml fails when wrapping any module that depends on ITK module includes.
Same symptom currently affects pixi-based builds where pixi.lock resolves CMake to 3.26.x.
Fix options
Bump Wrapping/CMakeLists.txt to cmake_minimum_required(VERSION 3.27). Smallest blast radius — ITK proper still builds with 3.22.1, only Python wrapping requires 3.27. This matches reality (most ITK consumers don't wrap from source) and is consistent with the Ubuntu 22.04 LTS rationale for the project-wide 3.22.1 floor.
Bump the project-wide cmake_minimum_required to 3.27. Cleanest, but pushes Ubuntu 22.04 LTS users (apt default cmake = 3.22.1, support until 2027) and RHEL 9 / Rocky 9 / Alma 9 users (cmake = 3.26.5) onto the Kitware apt repo or a manual install.
ITK's declared
cmake_minimum_requiredis 3.22.1, butWrapping/macro_files/itk_auto_load_submodules.cmakesilently requires CMake ≥ 3.27 since PR #5842 (merged 2026-03-05). Builds with CMake 3.22.1–3.26.x andITK_WRAP_PYTHON=ONproduce castxml input files with empty-I/-isystem/-Dflags and fail to find module headers.Root cause
PR #5842 / commit
7a59c6da41("BUG: Use module's interface include in wrapping's castxml") replaced configure-timestring(REPLACE …)with generation-time generator expressions in the castxml include-file template. The new template uses three nested$<LIST:JOIN,$<LIST:TRANSFORM,$<TARGET_PROPERTY:…>,REPLACE,…>,\n>constructs at:Wrapping/macro_files/itk_auto_load_submodules.cmake:124—INTERFACE_INCLUDE_DIRECTORIESWrapping/macro_files/itk_auto_load_submodules.cmake:128—INTERFACE_SYSTEM_INCLUDE_DIRECTORIESWrapping/macro_files/itk_auto_load_submodules.cmake:132—INTERFACE_COMPILE_DEFINITIONSThe
$<LIST:JOIN,…>and$<LIST:TRANSFORM,…>generator expressions were first released in CMake 3.27 (2023-07). The correspondinglist(JOIN …)/list(TRANSFORM …)commands have been around since CMake 3.12, which likely caused the version requirement to be overlooked — the generator-expression equivalents are much newer.On CMake < 3.27,
file(GENERATE)evaluates these expressions to empty strings (no diagnostic by default), so the generated*.castxml.incfile has no include flags and castxml fails when wrapping any module that depends on ITK module includes.Reproducer
Same symptom currently affects pixi-based builds where
pixi.lockresolves CMake to 3.26.x.Fix options
Bump
Wrapping/CMakeLists.txttocmake_minimum_required(VERSION 3.27). Smallest blast radius — ITK proper still builds with 3.22.1, only Python wrapping requires 3.27. This matches reality (most ITK consumers don't wrap from source) and is consistent with the Ubuntu 22.04 LTS rationale for the project-wide 3.22.1 floor.Bump the project-wide
cmake_minimum_requiredto 3.27. Cleanest, but pushes Ubuntu 22.04 LTS users (apt defaultcmake = 3.22.1, support until 2027) and RHEL 9 / Rocky 9 / Alma 9 users (cmake = 3.26.5) onto the Kitware apt repo or a manual install.Revert PR Refactor wrapping to use target properties and address bug building remote modules against an ITK build directory #5842 to the configure-time
string(REPLACE)form. Restores 3.22.1 compatibility but reintroduces the original bug (wrong include propagation when building remote modules against an ITK build directory).Rewrite the three generator expressions using only pre-3.27 primitives (e.g. resolve the target property at configure time and emit the joined string into
configure_file(... @ONLY)or a custom command). More invasive; reopens the original PR Refactor wrapping to use target properties and address bug building remote modules against an ITK build directory #5842 design discussion.Option 1 is the minimum-disruption fix.
References
7a59c6da41(2026-02-26)$<LIST:…>operators: https://cmake.org/cmake/help/v3.27/release/3.27.htmlcmake_minimum_required(VERSION 3.22.1...3.29.0)declared inCMakeLists.txt2fd36ab3a6(2024-12-19, 3.16.3 → 3.22.1)