[vtk-developers] Version tag and vtkversion defines for new module

Bill Lorensen bill.lorensen at gmail.com
Thu Jan 10 14:13:53 EST 2019


When I use
cmake_minimum_required(VERSION 3.0)


On Thu, Jan 10, 2019 at 6:05 AM Ben Boeckel <ben.boeckel at kitware.com> wrote:
>
> 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



-- 
Unpaid intern in BillsParadise at noware dot com


More information about the vtk-developers mailing list