Repository navigation
COMP: Do not include UseITK when building as an external module - #60
Closed
hjmjohnson wants to merge 1 commit into
Closed
hjmjohnson wants to merge 1 commit into
hjmjohnson wants to merge 1 commit into
Conversation
UseITK registers every IO factory of the ITK build as a directory-wide compile definition, so each test object references the *ImageIOFactoryRegister__Private symbols of modules this module never links, and the test driver fails to link against an ITK that has ITKIOGE or ITKIOFDF enabled. ITKModuleExternal already applies ITK's flags, and the module template does not include the use file.
hjmjohnson
marked this pull request as ready for review
October 7, 2026 18:08
Member
Author
|
Superceeded |
Member
Author
|
Superseded by #61, which carries this change as |
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.
Built externally against an ITK that enables
ITKIOGEorITKIOFDF,LesionSizingToolkitTestDriverandLesionSizingToolkitHeaderTest1fail to link with undefineditk::FDFImageIOFactoryRegister__Private()anditk::GE4ImageIOFactoryRegister__Private(). The top-levelinclude(${ITK_USE_FILE})is the cause; dropping it fixes the link, and the module template never includes the use file.Root cause
find_package(ITK REQUIRED)with no components requests every enabled module, andUseITK.cmakethen addsITK_IMAGEIO_FACTORY_REGISTER_MANAGERas a directory-wide compile definition with a generated header listing all 24 image IO factories of that ITK build. Every test object therefore references all 24*FactoryRegister__Privatesymbols, while the driver links only this module's dependencies andITKTestKernel's private IO set, which do not includeITKIOGEorITKIOFDF.ITKModuleExternal.cmakealready appliesITK_REQUIRED_*_FLAGS; the test driver registers the factories it needs throughitkTestDriverIncludeRequiredFactories.h.Test plan
Configured and built the module externally against ITK
main(clang, Release, macOS arm64,ITK_WRAP_PYTHON=ON,TEST_CORNELL_DATA_ROOTset) before and after. Before: both executables fail to link as above. After:build.ninjacarries noFACTORY_REGISTER_MANAGERdefinition, the driver links, andctestpasses 52 of 52, including the image-reading tests.