Skip to content

Python: wrap kits when VTK_ENABLE_KITS is ON

Max Smolens requested to merge msmolens/vtk:python-modules-kit-2 into master

This supersedes !1038 (closed).

Building kits for VTK Python modules is required for Slicer. This merge request ports changes to support this from Slicer's fork of VTK (https://github.com/Slicer/VTK). The changes here are originally based on the following commits:

https://github.com/Slicer/VTK/compare/61cdd20...61a46c

Taking vtkCommon as an example, before this change, a library is generated for each wrapped module:

vtkCommonColorPython27D-x.y.dll
vtkCommonComputationalGeometryPython27D-x.y.dll
vtkCommonCorePython27D-x.y.dll
vtkCommonDataModelPython27D-x.y.dll
vtkCommonExecutionModelPython27D-x.y.dll
vtkCommonMathPython27D-x.y.dll
vtkCommonMiscPython27D-x.y.dll
vtkCommonSystemPython27D-x.y.dll
vtkCommonTransformsPython27D-x.y.dll

Now, single "kit" library is generated:

vtkCommonKitPython27D-x.y.dll

The wrapped kits have the suffix "Kit" to avoid naming conflicts with existing libraries like "vtkFilterPython".

As part of this change, the Python wrapping function has been split into two functions, one which wraps the code and another which builds the wrapped code. The new function is backwards compatible, but to update client code, replace calls like:

vtk_add_python_wrapping(${module})

with:

vtk_add_python_wrapping(${module} module_srcs)
vtk_add_python_wrapping_library(${module} module_srcs ${module})

Merge request reports