Skip to content

WIP: Use interface library variable - #470

Draft
blowekamp wants to merge 3 commits into
InsightSoftwareConsortium:mainfrom
blowekamp:use_interface_libraries
Draft

WIP: Use interface library variable#470
blowekamp wants to merge 3 commits into
InsightSoftwareConsortium:mainfrom
blowekamp:use_interface_libraries

Conversation

@blowekamp

Copy link
Copy Markdown
Member

This is currently not working as I expected. The ITK_INTERFACE_LIBRARIES contains all the ITK modules, but not the meta-modules to enable the factories.

@github-actions github-actions Bot added area:Filtering Issues affecting the Filtering module type:Infrastructure Infrastructure/ecosystem related changes, such as CMake or buildbots labels Jun 16, 2026
@blowekamp blowekamp changed the title WIP: Use interface libraries WIP: Use interface library variable Jun 18, 2026
@blowekamp

Copy link
Copy Markdown
Member Author

One underlying problem with this PR is that multiple calls to find_package are caches so the components of the first one are return in subsequent calls.

hjmjohnson and others added 2 commits September 11, 2026 15:35
# Conflicts:
#	src/Filtering/AnisotropicSmoothing/ComputeCurvatureAnisotropicDiffusion/CMakeLists.txt
find_package(ITK COMPONENTS ...) takes module names; the ITK::...Module
spellings are target names. ITKImageBase, ITKAnisotropicSmoothingModule,
and ITKImageIntensityModule are not modules, so ITKModuleAPI.cmake stops
with "No such module".

List ITKIOImageBase, ITKAnisotropicSmoothing, ITKImageIntensity, and the
ITKImageIO factory meta-module, and link ITK::ITKImageIO as the ITK 6
migration guide shows. Built against ITK main, the executable links the
same 52 ITK libraries and registers the same 24 ImageIO factories as the
explicit-target form, and its output is byte-identical.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S5zzoU6yyUwdLEvjM2s6iS
hjmjohnson added a commit to hjmjohnson/ITKSphinxExamples that referenced this pull request Sep 12, 2026
Request the modules the example uses as find_package(ITK COMPONENTS)
and link ${ITK_INTERFACE_LIBRARIES}, the form the ITK 6 migration guide
recommends. The ITKImageIO factory meta-module is both requested and
linked, since linking it is what enables the generated registration.

Component names are module names (ITKAnisotropicSmoothing), not the
ITK::...Module target names.

Supersedes InsightSoftwareConsortium#470.

Co-Authored-By: Bradley Lowekamp <321061+blowekamp@users.noreply.github.com>
hjmjohnson added a commit to hjmjohnson/ITKSphinxExamples that referenced this pull request Sep 12, 2026
Request the modules the example uses as find_package(ITK COMPONENTS)
and link ${ITK_INTERFACE_LIBRARIES}, the form the ITK 6 migration guide
recommends. The ITKImageIO factory meta-module is both requested and
linked, since linking it is what enables the generated registration.

Component names are module names (ITKAnisotropicSmoothing), not the
ITK::...Module target names.

Supersedes InsightSoftwareConsortium#470.

Co-Authored-By: Bradley Lowekamp <321061+blowekamp@users.noreply.github.com>
hjmjohnson added a commit to hjmjohnson/ITKSphinxExamples that referenced this pull request Sep 12, 2026
Request the modules the example uses as find_package(ITK COMPONENTS)
and link ${ITK_INTERFACE_LIBRARIES}, the form the ITK 6 migration guide
recommends. The ITKImageIO factory meta-module is both requested and
linked, since linking it is what enables the generated registration.

Component names are module names (ITKAnisotropicSmoothing), not the
ITK::...Module target names.

Supersedes InsightSoftwareConsortium#470.

Co-Authored-By: Bradley Lowekamp <blowekamp@mail.nih.gov>
hjmjohnson added a commit to hjmjohnson/ITKSphinxExamples that referenced this pull request Sep 13, 2026
Name the ITK modules behind each example's includes and link targets as
find_package COMPONENTS, so configure fails with "No such module" when a
module is missing rather than with a missing target at generate time.

Link lines are unchanged: each example keeps its explicit
ITK::<Name>Module targets, which show a reader which module provides
which class.

Follows the COMPONENTS approach proposed in InsightSoftwareConsortium#470.

Co-Authored-By: Bradley Lowekamp <blowekamp@mail.nih.gov>
hjmjohnson added a commit to hjmjohnson/ITKSphinxExamples that referenced this pull request Sep 13, 2026
Name the ITK modules behind each example's includes and link targets as
find_package COMPONENTS, so configure fails with "No such module" when a
module is missing rather than with a missing target at generate time.

Link lines are unchanged: each example keeps its explicit
ITK::<Name>Module targets, which show a reader which module provides
which class.

Follows the COMPONENTS approach proposed in InsightSoftwareConsortium#470.

Co-Authored-By: Bradley Lowekamp <blowekamp@mail.nih.gov>
hjmjohnson added a commit to hjmjohnson/ITKSphinxExamples that referenced this pull request Sep 13, 2026
Name the ITK modules behind each example's includes and link targets as
find_package COMPONENTS, so configure fails with "No such module" when a
module is missing rather than with a missing target at generate time.

Link lines are unchanged: each example keeps its explicit
ITK::<Name>Module targets, which show a reader which module provides
which class.

Follows the COMPONENTS approach proposed in InsightSoftwareConsortium#470.

Co-Authored-By: Bradley Lowekamp <blowekamp@mail.nih.gov>
hjmjohnson added a commit to hjmjohnson/ITKSphinxExamples that referenced this pull request Sep 13, 2026
Name the ITK modules behind each example's includes and link targets as
find_package COMPONENTS, so configure fails with "No such module" when a
module is missing rather than with a missing target at generate time.

Link lines are unchanged: each example keeps its explicit
ITK::<Name>Module targets, which show a reader which module provides
which class.

Follows the COMPONENTS approach proposed in InsightSoftwareConsortium#470.

Co-Authored-By: Bradley Lowekamp <blowekamp@mail.nih.gov>
hjmjohnson added a commit to hjmjohnson/ITKSphinxExamples that referenced this pull request Sep 13, 2026
Name the ITK modules behind each example's includes and link targets as
find_package COMPONENTS, so configure fails with "No such module" when a
module is missing rather than with a missing target at generate time.

Link lines are unchanged: each example keeps its explicit
ITK::<Name>Module targets, which show a reader which module provides
which class.

Follows the COMPONENTS approach proposed in InsightSoftwareConsortium#470.

Co-Authored-By: Bradley Lowekamp <blowekamp@mail.nih.gov>
hjmjohnson added a commit to hjmjohnson/ITKSphinxExamples that referenced this pull request Sep 13, 2026
Name the ITK modules behind each example's includes and link targets as
find_package COMPONENTS, so configure fails with "No such module" when a
module is missing rather than with a missing target at generate time.

Link lines are unchanged: each example keeps its explicit
ITK::<Name>Module targets, which show a reader which module provides
which class.

Follows the COMPONENTS approach proposed in InsightSoftwareConsortium#470.

Co-Authored-By: Bradley Lowekamp <blowekamp@mail.nih.gov>
hjmjohnson added a commit to hjmjohnson/ITKSphinxExamples that referenced this pull request Sep 13, 2026
Name the ITK modules behind each example's includes and link targets as
find_package COMPONENTS, so configure fails with "No such module" when a
module is missing rather than with a missing target at generate time.

Link lines are unchanged: each example keeps its explicit
ITK::<Name>Module targets, which show a reader which module provides
which class.

Follows the COMPONENTS approach proposed in InsightSoftwareConsortium#470.

Co-Authored-By: Bradley Lowekamp <blowekamp@mail.nih.gov>
hjmjohnson added a commit to hjmjohnson/ITKSphinxExamples that referenced this pull request Sep 13, 2026
Name the ITK modules behind each example's includes and link targets as
find_package COMPONENTS, so configure fails with "No such module" when a
module is missing rather than with a missing target at generate time.

Link lines are unchanged: each example keeps its explicit
ITK::<Name>Module targets, which show a reader which module provides
which class.

Follows the COMPONENTS approach proposed in InsightSoftwareConsortium#470.

Co-Authored-By: Bradley Lowekamp <blowekamp@mail.nih.gov>
hjmjohnson added a commit to hjmjohnson/ITKSphinxExamples that referenced this pull request Sep 13, 2026
Name the ITK modules behind each example's includes and link targets as
find_package COMPONENTS, so configure fails with "No such module" when a
module is missing rather than with a missing target at generate time.

Link lines are unchanged: each example keeps its explicit
ITK::<Name>Module targets, which show a reader which module provides
which class.

Follows the COMPONENTS approach proposed in InsightSoftwareConsortium#470.

Co-Authored-By: Bradley Lowekamp <blowekamp@mail.nih.gov>
hjmjohnson added a commit to hjmjohnson/ITKSphinxExamples that referenced this pull request Sep 13, 2026
Name the ITK modules behind each example's includes and link targets as
find_package COMPONENTS, so configure fails with "No such module" when a
module is missing rather than with a missing target at generate time.

Link lines are unchanged: each example keeps its explicit
ITK::<Name>Module targets, which show a reader which module provides
which class.

Follows the COMPONENTS approach proposed in InsightSoftwareConsortium#470.

Co-Authored-By: Bradley Lowekamp <blowekamp@mail.nih.gov>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:Filtering Issues affecting the Filtering module type:Infrastructure Infrastructure/ecosystem related changes, such as CMake or buildbots

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants