[vtk-developers] VTK module system uplift to CMake 3.0 features

Ben Boeckel ben.boeckel at kitware.com
Mon Mar 2 14:52:06 EST 2015


Hi,

We are currently toying with the idea to update the module system to use
more modern CMake features such as usage requirements, interface
libraries, etc.

The benefits for end-users include:

  - find_package(COMPONENTS) will be simpler.
    * basically, COMPONENTS will become nothing more than a check that
      the components are available; all available components will always
      be loaded. This means VTK_INCLUDE_DIRS and friends no longer
      change values based on the last find_package() call.
  - no need to do include_directories(), link_directories(),
    add_definitions() for each dependent module (for libraries not using
    module.cmake). Instead target_link_libraries(myapp vtkmod1 vtkmod2)
    would get everything necessary.
    * this also means vtk_mpi_link will not be necessary anymore;
      linking to vtkMPI (or similar) should bring in everything.
      Currently, the way it is set up, include(vtkMPI) is required and
      then vtk_mpi_link(mymodule) is needed to properly get everything
      MPI needs.
  - during the transition, VTK's module dependencies will likely be
    audited and can hopefully be made more accurate (e.g., removing
    unnecessary dependencies, making dependencies private where
    possible, etc.).
  - faster configure time since lots of CMake code won't be running
    anymore and instead handled by CMake itself in C++ code. There are
    other factors which should help here (such as greatly reducing the
    number of variables floating around).

The CMake code for modules themselves is already highly declarative, so
it is unlikely that many changes will be necessary for them. It would
mean bumping the CMake minimum version to at least 3.0 though.

Thoughts?

Thanks,

--Ben


More information about the vtk-developers mailing list