Skip to content

COMP: Build against ITK 6 - #7

Open
hjmjohnson wants to merge 4 commits into
InsightSoftwareConsortium:mainfrom
hjmjohnson:itk6-compat
Open

hjmjohnson wants to merge 4 commits into
InsightSoftwareConsortium:mainfrom
hjmjohnson:itk6-compat

Conversation

@hjmjohnson

Copy link
Copy Markdown
Member

Build against ITK 6 while keeping ITK 5.4: ITK_DISALLOW_COPY_AND_MOVE, terminating semicolons on three itkExceptionMacro/itkGetConstObjectMacro invocations (the ITK 6 expansions end in a declaration), and the module's include directory on the example target so it builds outside an ITK source tree.

Verification

Configured with ITK_DIR pointing at an installed ITK 6 tree (upstream main as of 2026-09-22, ITK_WRAP_PYTHON=ON), built the module and its Python wrapping, and imported the wrapped module from Python. The module still builds against ITK 5.4.

Four changes, all of which keep the module building against ITK 5.4 as well.

ITK 6 turns ITK_DISALLOW_COPY_AND_ASSIGN into a static assertion asking for
ITK_DISALLOW_COPY_AND_MOVE, which ITK 5.4 defines as well.

Three itkExceptionMacro and itkGetConstObjectMacro invocations were written
without a terminating semicolon. The ITK 6 expansions end in a declaration
rather than a statement, so the semicolon is now required.

The example read the module's own headers, which only reach the compiler by
accident when the module is built inside an ITK source tree. Name the include
directory on the target so the example also builds against an installed ITK.

The packaged wheel pinned itk == 5.4.*, which would make it uninstallable
against the ITK 6 it now also builds against. Open the floor to itk >= 5.4.
Every source file's line 9 read http://www.apache.org, one letter short
of the https:// KWStyle's ITKHeader.h template requires, so
TrimmedPointSetRegistrationKWStyleTest failed on every file. Present since
the module's initial commit.
The last bullet in the TODO list used three leading spaces where every
sibling used two, so docutils read it as starting a new nested list with
no closing blank line. twine check failed the wheel on every platform
with "Bullet list ends without a blank line; unexpected unindent."
MSVC's C4018 flagged four of these as build warnings, which
ci_completed_successfully treats as fatal; the other three compile
without warning here but are the identical mismatch and would surface
the same way once the reported ones are fixed. All eight loop indices
now match the unsigned type they are compared against.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant