[Insight-developers] ITK-Modularization Install issue -- library names of imported libs?

Brad King brad.king at kitware.com
Mon Jul 30 14:32:40 EDT 2012


On 07/30/2012 02:12 PM, Williams, Norman K wrote:
> This is kind of wacky, and once again I am being thwarted by doing
> something never done before:
> 
> I have the DCMTK install working almost 100%.  The not-working part: If
> you build in ITK, the DCMTK libraries are added with ADD_LIBRARY(libname
> STATIC imported).
> Within an ITK build -- i.e. when the test program for ITKDCMTKImageIO is
> built -- CMake is smart enough to replace the import library name (e.g.
> ITKDCMTK_data) with the actual path of the library.
> 
> But when the *.cmake files are created for an ITK install, they don't
> distinguish between an imported library target and a local library target.
>  ITK_LIBRARIES contains the library's import name (e.g. ITKDCMTK_data)
> instead of the actual library name (e.g. libdcmdata.a).

We would need custom content in the ITKDCMTK.cmake module information
file to provide the imported targets.  However, see next response.

> I'm sure what this comes down to is changing how the ITK CMake files are
> configured. The IMPORTED_LINK_INTERFACE_LIBRARIES property needs to be
> checked.  But I don't know where exactly to do this.

This can be set to hide DCMTK from the public interface altogether
so that the imported targets are not referenced at all.  Just set
the LINK_INTERFACE_LIBRARIES (without IMPORTED_ prefix) property
of the corresponding targets in the CMakeLists.txt files.  CMake
will propagate that to the target files in the install tree.

-Brad


More information about the Insight-developers mailing list