[vtk-developers] Version tag and vtkversion defines for new module
Ben Boeckel
ben.boeckel at kitware.com
Thu Jan 10 09:05:05 EST 2019
On Thu, Jan 10, 2019 at 05:24:17 +0000, Andras Lasso wrote:
> Yes, we need this. Please give us examples that show how to write our
> CMake and C++ files to work with both the old and new VTK module
> system.
I have some patches for WikiExamples locally, but have been focusing on
the dashboards first.
For supporting both, something like this pattern is what I was doing:
find_package(VTK)
if (VTK_VERSION VERSION_LESS "8.90")
# old system
include(${VTK_USE_FILE})
# modules are linked via `vtkCommonCore`
# VTK_DEFINITIONS has autoinit information
else ()
# modules are linked via `VTK::CommonCore`
# vtk_module_autoinit is needed
endif ()
WikiExamples also tries to support VTK5, so it has a bit more logic to
go in there as well.
--Ben
More information about the vtk-developers
mailing list