Skip to content

IO factories in external module fails at configuration #5760

Closed

Description

@SimonRit

Description

Trying to compile RTK externally after compiling the latest ITK main. I get the following error at configuration

CMake Error at /home/srit/src/itk/itk/CMake/ITKModuleMacros.cmake:429 (target_link_libraries):
  Cannot specify link libraries for target "ITKImageIO" which is not built by
  this project.
Call Stack (most recent call first):
  /home/srit/src/itk/itk/CMake/ITKModuleExternal.cmake:202 (itk_module_impl)
  CMakeLists.txt:258 (include)

This is likely caused by #5721.

Steps to Reproduce

Compile ITK.
Then download RTK and configure RTK separately.

Expected behavior

Configuration of the project.

Actual behavior

Fails with the above error

Reproducibility

100%

Versions

Latest ITK in the main branch, Ubuntu.

Activity

  1. added
    type:BugInconsistencies or issues which will cause an incorrect result under some or all circumstances
    on Feb 3, 2026
  2. SimonRit commented on Feb 3, 2026

    @SimonRit
    Author

    Sorry @blowekamp, I don't know how to solve this...

  3. blowekamp commented on Feb 3, 2026

    @blowekamp
    Member

    I only tested RTK when is was enabled as part of the ITK build. This is RTK built against a build directory of ITK?

  4. SimonRit commented on Feb 3, 2026

    @SimonRit
    Author

    Yes exactly. And the problem disappears if I comment out the following lines
    https://github.com/RTKConsortium/RTK/blob/main/itk-module.cmake#L53-L61
    I just tested ITKIOScanco and there is the same problem so it's probably preferable to use this as a smaller test.

  5. SimonRit commented on Feb 5, 2026

    @SimonRit
    Author

    Fixed by #5763.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:BugInconsistencies or issues which will cause an incorrect result under some or all circumstances

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions