Skip to content

Wrapping an external module against an installed ITK writes into the installed prefix #6923

Description

@hjmjohnson

When an external module is wrapped against an installed ITK (#6891 with ITK_INSTALL_WRAPPING_DEVELOPMENT_FILES=ON), its generated SWIG indices and the wrapped library are written into the installed prefix, so wrapping fails against a read-only prefix.

Wrapping/CMakeLists.txt sets WRAPPER_MASTER_INDEX_OUTPUT_DIR to ${ITK_DIR}/Wrapping/Typedefs and resolves dependency .mdx files from that single directory. CMAKE_LIBRARY_OUTPUT_DIRECTORY and the .pyi/pickle directories derive from ${ITK_DIR} the same way. Against a build tree that means a module writes into ITK's build tree, which has always been the case; against an install tree ITK_DIR is <prefix>/lib/cmake/ITK-6.0, so the module writes Wrapping/Typedefs/<Module>.{idx,mdx}, Wrapping/castxml_inputs/, and Wrapping/Generators/Python/itk/_<Module>Python.so under <prefix>.

Observed with RTK and ITKCudaCommon against a user-writable prefix, where it works. A prefix such as /usr or a conda package would fail at the first file(WRITE).

Proposed follow-up: keep the module's outputs in its own build tree (${CMAKE_BINARY_DIR}/Wrapping/...) and give the .mdx/.idx lookup a search path, ITK's installed Wrapping/Typedefs plus the module's own output directory, so dependency indices are read from ITK and new ones are written locally. igenerator.py already takes multiple --mdx arguments, so the change is on the CMake side.

No activity

Activity on this issue will appear here.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions