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.
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.txtsetsWRAPPER_MASTER_INDEX_OUTPUT_DIRto${ITK_DIR}/Wrapping/Typedefsand resolves dependency.mdxfiles from that single directory.CMAKE_LIBRARY_OUTPUT_DIRECTORYand 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 treeITK_DIRis<prefix>/lib/cmake/ITK-6.0, so the module writesWrapping/Typedefs/<Module>.{idx,mdx},Wrapping/castxml_inputs/, andWrapping/Generators/Python/itk/_<Module>Python.sounder<prefix>.Observed with RTK and ITKCudaCommon against a user-writable prefix, where it works. A prefix such as
/usror a conda package would fail at the firstfile(WRITE).Proposed follow-up: keep the module's outputs in its own build tree (
${CMAKE_BINARY_DIR}/Wrapping/...) and give the.mdx/.idxlookup a search path, ITK's installedWrapping/Typedefsplus the module's own output directory, so dependency indices are read from ITK and new ones are written locally.igenerator.pyalready takes multiple--mdxarguments, so the change is on the CMake side.