Hi all,
I created a VTK algorithm in Python using VTKPythonAlgorithmBase, which served me well. However, it doesn’t scale as it requires a few python for loops, which are infamously slow!
I want to translate the code to C++, but I’d still like to be able to call the functionality from Python. I had a look through discourse and SO but didn’t get much far.
I took inspiration (copied) from https://gitlab.kitware.com/vtk/vtk/-/tree/master/Examples/Modules/Wrapping and created a simple CMake/C++ project to prepare for my development.
I installed VTK, CMake and Python within a conda environment, and this would be my preferred way to build/distribute.
My code can be found at https://github.com/paskino/vtk-wrap-python/tree/main/src/Wrapping
I am running
cmake <src_dir> -DCMAKE_INSTALL_PREFIX=%CONDA_PREFIX%
on windows and
cmake <src_dir> -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX
on linux.
CMake fails with this error
CMake Error at /home/edo/scratch/miniconda3/envs/vtkdev/lib/cmake/vtk-9.2/VTK-targets.cmake:360 (set_target_properties):
The link interface of target "VTK::Python" contains:
Python3::Module
but the target was not found. Possible reasons include:
* There is a typo in the target name.
* A find_package call is missing for an IMPORTED target.
* An ALIAS target is missing.
Call Stack (most recent call first):
/home/edo/scratch/miniconda3/envs/vtkdev/lib/cmake/vtk-9.2/vtk-config.cmake:138 (include)
CMakeLists.txt:8 (find_package)
I added a find_package(Python COMPONENTS Interpreter Development)
but it seems irrelevant.
What am I missing?
Thanks for your help.
Edoardo