[vtkusers] probe vtk6 installation for AUTOINIT values

Marcus D. Hanwell marcus.hanwell at kitware.com
Thu Aug 16 13:32:30 EDT 2012

On Tue, Aug 14, 2012 at 6:09 PM, Trevor Irons <trevorirons at gmail.com> wrote:
> I suppose this is a CMake question, but it pertains to VTK, so I apologize
> if it is not the right place to ask this.
> Is there any way to probe an existing VTK 6  installation for the AUTOINIT
> string that is used during compilation. For instance on my local machine,
> these define statements are necessary
> -DvtkRenderingCore_AUTOINIT="3(vtkInteractionStyle,vtkRenderingFreeTypeOpenGL,vtkRenderingOpenGL)"
> -DvtkRenderingVolume_AUTOINIT="1(vtkRenderingVolumeOpenGL)"
> But hard coding these values will clearly not be portable. If anyone has
> found a solution to this I'd appreciate any ideas. For what it's worth, I'm
> using SCons instead of CMake to build a library which can use an existing
> VTK installation. So it is possible to parse through files, but not simply
> grab CMake variables (that I know of at least).
Hard coding those lines should be quite portable, you can look at how
we generate the definitions in the CMake/vtkModuleAPI.cmake files. The
modules have module.cmake files, and these contain information about
which module a particular module might provide implementations for
(IMPLEMENTS in the module.cmake files).

They are providing a map for the compiler, i.e. vtkRenderingCore has 3
modules that implement parts of its API. That define will ensure that
the object factory for the three modules will be initialized.
vtkRenderingVolume has just one implementation module, and its object
factory code will be initialized.

Hope that helps.


More information about the vtkusers mailing list