[Insight-developers] ITKExamples: Linker issues with an itk build with vtk

David Doria daviddoria at gmail.com
Tue Nov 13 14:27:19 EST 2012


On Tue, Nov 13, 2012 at 2:20 PM, Bill Lorensen <bill.lorensen at gmail.com> wrote:
> Matt,
>
> I built the examples against my own ITK that included the vtk glue
> classes. In order to get the examples to link I had to add
> if(ITKVtkGlue_LOADED)
>   find_package( VTK REQUIRED )
>   if( ${VTK_FOUND} )
>     include( ${VTK_USE_FILE} )
>   endif()
> endif()
>
> to
> src/Examples/CMakeLists.txt
>
> This could very well be an ITK issue, but these changes allowed me to
> build and link the examples.
>
> Bill

I believe I have seen several variants of this problem when building
other projects against ITK with ITKVtkGlue turned ON. Shouldn't ITK
already make VTK available to the client project? You shouldn't be
able to turn ITKVtkGlue on when building ITK if VTK is not found, so
one would assume that ITK has already included VTK since it requires
it. Then why should the client have to include it again?

And potentially the same problem - I've had projects that do NOT
require VTK fail to link when built against an ITK build with
ITKVtkGlue turned on because they could not find VTK libs (even though
they don't require them).

Summary - I think this is something that needs to be fixed in ITK (ITKVtkGlue).

David


More information about the Insight-developers mailing list