Dear @aborsic ,
the link to discussion is here External vtk 9.0 class with python wrapping (vtkWrapHierarchy) - #5 by EMalikova . Also, in addition to the example you have provided, this has been implemented in open source project, so the example of implementation with external dependencies involved could be found here (see src/CMakeLists vtk_module_add_module function, vtk_module_wrap_python in CMakeLists.txt and src/fits.module file).
I hope this helps,
Best of luck with your research:),
Best regards,
Evgeniya