WIP: Use interface library variable - #470
Draft
blowekamp wants to merge 3 commits into
Draft
Conversation
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. |
# 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.