<div class="gmail_quote">On 16 August 2012 17:32, Marcus D. Hanwell <span dir="ltr">&lt;<a href="mailto:marcus.hanwell@kitware.com" target="_blank">marcus.hanwell@kitware.com</a>&gt;</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 &lt;<a href="mailto:trevorirons@gmail.com">trevorirons@gmail.com</a>&gt; wrote:<br>
&gt; I suppose this is a CMake question, but it pertains to VTK, so I apologize<br>
&gt; if it is not the right place to ask this.<br>
&gt;<br>
&gt; Is there any way to probe an existing VTK 6  installation for the AUTOINIT<br>
&gt; string that is used during compilation. For instance on my local machine,<br>
&gt; these define statements are necessary<br>
&gt;<br>
&gt; -DvtkRenderingCore_AUTOINIT=&quot;3(vtkInteractionStyle,vtkRenderingFreeTypeOpenGL,vtkRenderingOpenGL)&quot;<br>
&gt; -DvtkRenderingVolume_AUTOINIT=&quot;1(vtkRenderingVolumeOpenGL)&quot;<br>
&gt;<br>
&gt; But hard coding these values will clearly not be portable. If anyone has<br>
&gt; found a solution to this I&#39;d appreciate any ideas. For what it&#39;s worth, I&#39;m<br>
&gt; using SCons instead of CMake to build a library which can use an existing<br>
&gt; VTK installation. So it is possible to parse through files, but not simply<br>
&gt; grab CMake variables (that I know of at least).<br>
&gt;<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&#39;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=\&quot;1(vtkRenderingVolumeMesa)\&quot; &#39;&#39;&#39;)<br> -DvtkRenderingCore_AUTOINIT=\&quot;3(vtkInteractionStyle,vtkRenderingFreeTypeMesa,vtkRenderingMesa)\&quot; <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>