<p dir="ltr">Den 2 juli 2016 2:45 em skrev "David Gobbi" <<a href="mailto:david.gobbi@gmail.com">david.gobbi@gmail.com</a>>:<br>
><br>
> On Sat, Jul 2, 2016 at 5:09 AM, Elvis Stansvik <<a href="mailto:elvis.stansvik@orexplore.com">elvis.stansvik@orexplore.com</a>> wrote:<br>
>><br>
>><br>
>> I'm actually a little unsure which set of modules that the script prints I should be using. It prints three set of modules: referenced, minimal and maximal. E.g:<br>
>><br>
>> Modules and their dependencies:<br>
>> find_package(VTK COMPONENTS<br>
>> vtkCommonColor<br>
>> vtkCommonComputationalGeometry<br>
>> vtkCommonCore<br>
>> vtkCommonDataModel<br>
>> vtkCommonExecutionModel<br>
>> vtkCommonMath<br>
>> vtkCommonMisc<br>
>> vtkCommonSystem<br>
>> vtkCommonTransforms<br>
>> vtkFiltersCore<br>
>> vtkFiltersGeneral<br>
>> vtkFiltersSources<br>
>> vtkGUISupportQt<br>
>> vtkImagingCore<br>
>> vtkInteractionStyle<br>
>> vtkRenderingCore<br>
>> vtkRenderingOpenGL<br>
>> vtkkwiml<br>
>> )<br>
>> Your application code includes 18 of 189 vtk modules.<br>
>><br>
>> All modules referenced in the files:<br>
>> find_package(VTK COMPONENTS<br>
>> vtkCommonCore<br>
>> vtkFiltersSources<br>
>> vtkGUISupportQt<br>
>> vtkRenderingCore<br>
>> vtkRenderingOpenGL<br>
>> )<br>
>> Your application code includes 5 of 189 vtk modules.<br>
>><br>
>> Minimal set of modules:<br>
>> find_package(VTK COMPONENTS<br>
>> vtkCommonCore<br>
>> vtkFiltersSources<br>
>> vtkGUISupportQt<br>
>> )<br>
>> Your application code includes 3 of 189 vtk modules.<br>
>><br>
>><br>
>> Would it be enough to use the minimal set? When would I want to use one of the other two?<br>
><br>
><br>
> The minimal set should work. But I always use the middle set, because I want to directly link every library that contains a class that I directly utilize. If I rely on library dependencies to bring in all the libraries I use, then I will be out of luck if a future release of VTK manages to eliminate some of the dependencies I was relying on.</p>
<p dir="ltr">Ah yes, makes sense.</p>
<p dir="ltr">><br>
> Note that the fact that this list contains an OpenGL/OpenGL2 library means extra logic is required when building the link line. I end up with a mess of cmake code that looks like this:<br>
><br>
> # Set VTK_LIBS to the libs I want to link<br>
> set(VTK_LIBS<br>
> vtkCommonCore vtkCommonDataModel vtkImagingCore<br>
> vtkIOImage vtkIOSQL<br>
> vtkRenderingImage vtkRenderingFreeType)<br>
> # Conditionally add these libs if present in VTK_LIBRARIES<br>
> set(VTK_FACTORY_LIBS<br>
> vtkIOMPIImage vtkIOMySQL<br>
> vtkRenderingOpenGL vtkRenderingFreeTypeOpenGL<br>
> vtkRenderingOpenGL2 vtkRenderingFreeTypeOpenGL2)<br>
> foreach(TMP_LIB ${VTK_FACTORY_LIBS})<br>
> list(FIND VTK_LIBRARIES ${TMP_LIB} TMP_INDEX)<br>
> if(TMP_INDEX GREATER -1)<br>
> set(VTK_LIBS ${VTK_LIBS} ${TMP_LIB})<br>
> endif()<br>
> endforeach()</p>
<p dir="ltr">Thanks, I might do this later, but for now I think I want to require the OpenGL2 backend and thus link against vtkRenderingOpenGL2 unconditionally. </p>
<p dir="ltr">The app will initially run on a computer we provide as part of our product (analysis machine), so we'll have full control of the environment in which it runs. But this might change.</p>
<p dir="ltr">Elvis<br>
</p>