[vtk-developers] New module system preview

Ben Boeckel ben.boeckel at kitware.com
Mon Oct 29 13:32:49 EDT 2018


On Mon, Oct 29, 2018 at 18:13:43 +0100, Elvis Stansvik wrote:
> > # Add VTK_AUTOINIT defines to the targets.
> > vtk_module_autoinit(TARGETS myexe1 myexe2 MODULES VTK::CommonCore)
> >
> 
> Can this not be brought in automatically via the target's interface
> definitions?

No, because the set of AUTOINIT defines depends on the modules you link.
Linking `VTK::ChemistryOpenGL2` and `VTK::ParallelChemistry` gives a
different AUTOINIT define than just linking `VTK::ChemistryOpenGL2`.

> With the current setup, I'm getting them via ${VTK_DEFINITIONS} I think.

This is true. Currently, it is for all modules that VTK is told to find.

> Would be nice to avoid the repeated target name.

I think instead of `MODULES`, it might be possible to instead rummage
around in the link properties of the passed targets. However, looking at
the documentation, this is not necessarily trivial to parse:

    https://cmake.org/cmake/help/latest/prop_tgt/LINK_LIBRARIES.html

I'll add a TODO item for it, but I imagine that it will not work for all
possible ways to use `target_link_libraries`.

--Ben


More information about the vtk-developers mailing list