[Insight-developers] Building ITK with Module_ITKVtkGlue forces client applications to find_package(VTK)?

David Doria daviddoria at gmail.com
Tue Jul 3 11:16:25 EDT 2012


On Tue, Jun 26, 2012 at 1:36 PM, Xiaoxiao Liu <xiaoxiao.liu at kitware.com>wrote:

> Some of my thoughts:
>
> 1). I agreed that we haven't take full advantage of modular VTK in ITK yet.
>      VtkGlue module itself should only depends on several VTK modules
> instead of entire VTK_LIBRAIRES.
>
> 2) When building ITK, ITK_LIBRAIRES should  include all depending
> libraries turned on by enabled modules.
>    Users then should be able do
> *               Find( ITK     Required     ITKCommon  ITKVtkGlue) *
>    in their itk application code without specifying "Find(VTK .....)" in
> their own code, unless their code depends on
>    some other vtk modules  which are not specified in VtkGlue's dependency
> list.
>

The main problem I see is the following case:

I have ProjectA that only relies on ITK (without ITKVtkGlue). It has built
for years with ITK built without ITKVtkGlue and using only:

FIND_PACKAGE(ITK REQUIRED)
INCLUDE(${USE_ITK_FILE})

Then I have another project, ProjectB, that does need ITKVtkGlue. For this
project, I have to compile ITK with ITKVtkGlue, and then additionally use:

FIND_PACKAGE(VTK REQUIRED)
INCLUDE(${USE_VTK_FILE})

This is fine for ProjectB (though potentially confusing), but now ProjectA
doesn't build against ITK anymore! And I have to go add:

FIND_PACKAGE(VTK REQUIRED)
INCLUDE(${USE_VTK_FILE})

to ProjectA's CMakeLists.txt even though it doesn't require VTK at all
(even via ITK)! The big problem comes when someone pulls my repository of
ProjectA and they actually don't have VTK on their system at all. Why
should they have to modify the CMakeLists.txt file just because they don't
have a library that isn't required?

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-developers/attachments/20120703/3341e823/attachment.htm>


More information about the Insight-developers mailing list