<div class="gmail_quote">On 16 August 2012 17:32, Marcus D. Hanwell <span dir="ltr"><<a href="mailto:marcus.hanwell@kitware.com" target="_blank">marcus.hanwell@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">On Tue, Aug 14, 2012 at 6:09 PM, Trevor Irons <<a href="mailto:trevorirons@gmail.com">trevorirons@gmail.com</a>> wrote:<br>
> I suppose this is a CMake question, but it pertains to VTK, so I apologize<br>
> if it is not the right place to ask this.<br>
><br>
> Is there any way to probe an existing VTK 6 installation for the AUTOINIT<br>
> string that is used during compilation. For instance on my local machine,<br>
> these define statements are necessary<br>
><br>
> -DvtkRenderingCore_AUTOINIT="3(vtkInteractionStyle,vtkRenderingFreeTypeOpenGL,vtkRenderingOpenGL)"<br>
> -DvtkRenderingVolume_AUTOINIT="1(vtkRenderingVolumeOpenGL)"<br>
><br>
> But hard coding these values will clearly not be portable. If anyone has<br>
> found a solution to this I'd appreciate any ideas. For what it's worth, I'm<br>
> using SCons instead of CMake to build a library which can use an existing<br>
> VTK installation. So it is possible to parse through files, but not simply<br>
> grab CMake variables (that I know of at least).<br>
><br>
</div></div>Hard coding those lines should be quite portable, you can look at how<br>
we generate the definitions in the CMake/vtkModuleAPI.cmake files. The<br>
modules have module.cmake files, and these contain information about<br>
which module a particular module might provide implementations for<br>
(IMPLEMENTS in the module.cmake files).<br>
<br>
They are providing a map for the compiler, i.e. vtkRenderingCore has 3<br>
modules that implement parts of its API. That define will ensure that<br>
the object factory for the three modules will be initialized.<br>
vtkRenderingVolume has just one implementation module, and its object<br>
factory code will be initialized.<br>
<br>
Hope that helps.<br>
<span class="HOEnZb"><font color="#888888"><br>
Marcus<br>
</font></span></blockquote></div><br>Thanks a lot Marcus, I'll try and make sense of that CMake file. If I follow you though, I should just be able to search for vtkRenderingOpenGL or Mesa or (whatever else) and whichever exists just change this define statement? Is that correct? So if I detect say Mesa(sp? MESA) libraries like <br>
vtkRenderingVolumeMesa.so <br><br>Then just use <br> -DvtkRenderingVolume_AUTOINIT=\"1(vtkRenderingVolumeMesa)\" ''')<br> -DvtkRenderingCore_AUTOINIT=\"3(vtkInteractionStyle,vtkRenderingFreeTypeMesa,vtkRenderingMesa)\" <br>
<br>Is this accurate? Will vtkInteractionStyle always be without the engine name appended to it?<br><br>Cheers, <br><br>Trevor<br><br><br>