Skip to content

Improve external module support

This commit backports the ITK external module infrastructure to allow building against a collection of VTK module externally built.

In a nutshell, config files [1] associated with external modules are now configured into the VTK module directory found in the VTK binary directory and they have to be explicitly listed as components when using find_package(VTK COMPONENTS NameOfExternalModule REQUIRED).

More specifically, it implements the following changes:

  • List of enabled VTK module is now configured into VTKConfig.cmake instead of being set based on the list of *.cmake found in the VTK module directory. This allows to only consider VTK modules enabled in the original VTK build directory when using signature find_package(VTK REQUIRED) in user code or VTK remote module.

  • Each external module is now associated with its own target file independent of VTKTargets.cmake

[1] module config files:

lib/cmake/vtk-8.1/Modules/vtkNameOfExternalModule-Headers.cmake
lib/cmake/vtk-8.1/Modules/vtkNameOfExternalModule.cmake
lib/cmake/vtk-8.1/Modules/vtkNameOfExternalModuleHierarchy.txt
Edited by Jean-Christophe Fillion-Robin

Merge request reports