The vmtk project relied on the cmake file vtkWrapPython.cmake and it looks that has gone away, which I have no preference about and imagine the newer stuff makes more sense, however in desiring to build vmtk with the newest versions of VTK and ITK, I am not sure where to start with modifying the build system to accommodate the updates to the vtk python wrapping.
The module system docs are the place to start. I never got around to migration docs, so following the docs on the new module system is the easiest thing to do.
it looks like if one is only targeting vtk 9.0 and python, most of stuff in the CMakeLists for a library is pretty smalll and the rest is cruft for older versions? am I interpreting this correctly?
from vtk-dicom/blob/master/Source/CMakeLists.txt
if(DEFINED VTK_MODULE_ENABLE_VTK_DICOM)
# When building as a module for VTK 8.90 or later
set(LIB_SRC_HDRS)
foreach(_src ${LIB_SRCS})
get_filename_component(_base ${_src} NAME_WE)
list(APPEND LIB_SRC_HDRS ${_base}.h)
endforeach()
vtk_module_add_module(VTK::DICOM
SOURCES ${LIB_SRCS}
HEADERS ${LIB_SRC_HDRS} ${LIB_HDRS})
vtk_module_link(VTK::DICOM
PRIVATE ${GDCM_LIBS} ${DCMTK_LIBS} ${SQLITE_LIBS})
is it required that VTK::CommonColor be named starting with VTK:: or can it be anything.
where do I need to look in order to put several modules together i think kit is the word used in the documentation. I suppose I can just look at the modules in vtk.
It would be nice to have an example project that has all this without the cruft.
Just adding a KIT kitname and a corresponding vtk.kit file should do it. Note that you’ll need to make sure you sill don’t have any dependency loops between kits. CMake will detect problems with messages about circular dependencies between non-static libraries. The module docs have more details.
The VTK Python wrapper in vtkAddon is used for Python wrapping of VMTK and several other VTK-based libraries that are built outside VTK. You should be able to use it the same way as it is done in VMTK.