[vtk-developers] Use LINK_INTERFACE_LIBRARIES for VTK libs

Brad King brad.king at kitware.com
Wed Jul 22 08:35:18 EDT 2009


Mathieu Malaterre wrote:
> Could you comment on the attached patch ?

I think it is too aggressive.  We have always relied on vtkFiltering
pulling in vtkCommon automatically.  Since both are provided by VTK
it is not a problem.

Your debian bug report is about *third-party* dependencies of vtkIO.
I didn't check but I'm sure that the debian package uses system utility
libraries instead of the ones from VTK/Utilities.  The problem is
that we currently put the utilities in the link interface of vtkIO
just because it needs them for implementation.  That requires the
debian libvtk5-dev package to depend on the libfoo-dev packages for
all the third-party libraries unnecessarily.

The goal of setting a link interface is to avoid extra dependencies.
KDE went through the same process as soon as CMake 2.6 was released.

It would be nice to avoid the "VTK_LIBRARY_NO_TRANSITIVE_LINKING"
option and just always do this, since it is the right thing to do.
We do not include these third-party header files in our public
headers, so the only way a user could be using one of the libraries
is to include the headers directly...in which case the user should
link directly to the third-party library too.

There *could* be applications that include <jpeglib.h> and then
link to vtkIO but not jpeg.  Currently that would work, but only
when VTK_USE_SYSTEM_JPEG is ON.  When the option is OFF, we do
not expose an include path containing jpeglib.h from Utilities.
One must include vtk_jpeg.h to use our utility jpeg library.

We could try just removing third-party dependencies from vtkIO
and other libraries.  In */CMakeLists.txt, put only VTK libs in
KIT_LIBS; others in KIT_3P_LIBS.  Then in CMake/KitCommonBlock
link to both but put only KIT_LIBS in the link interface.

If this becomes a problem for compatibility we could be less
aggressive by leaving out only dependencies on third-party
libs we do not provide.  For example, when VTK_USE_SYSTEM_JPEG
is ON, we drop jpeg from vtkIO's link interface.  This would
solve the debian packaging problem.

-Brad



More information about the vtk-developers mailing list