Can't cross compile against VTK when using vtk_module_wrap_python
We have a package (visan) that contains a custom VTK module that we create python bindings for using vtk_module_wrap_python
/VTK::WrapPython
.
This package is available on conda-forge and we are trying to create a macos arm64 build for this, which requires cross-compilation.
However, this is giving us problems. See the current pull request at https://github.com/conda-forge/visan-feedstock/pull/18.
The main issue seems to be that the CMake configuration that comes with a VTK installation expects everything to be found in one location.
In VTK-Targets.cmake every target is located against a common _IMPORT_PREFIX
, independent of whether this should come from the build or target platform.
Similar to how locations for PROGRAM
, LIBRARY
, and INCLUDE
can be split as described in the CMake Cross Compilation documentation, we would need a similar way to have the IMPORT_LOCATION
be independently specified for build time executables such as VTK::WrapPython
on one hand and for target platform headers/libraries on the other.
Since the VTK CMake configuration does not use find_program
to locate VTK::WrapPython
, setting CMAKE_FIND_ROOT_PATH_MODE_PROGRAM
to NEVER
as recommended for cross-compilation will have no effect.