[CMake] IMPORTED_LINK_DEPENDENT_LIBRARIES not working anymore?

Brad King brad.king at kitware.com
Thu Mar 14 09:20:11 EDT 2013


On 03/14/2013 12:43 AM, James Bigler wrote:
> I'm not sure what the expected behavior is supposed to be

IMPORTED_LINK_DEPENDENT_LIBRARIES is not about transitive linking.
That is IMPORTED_LINK_INTERFACE_LIBRARIES.

The former is only for implementation dependencies of a shared
library that are not in its link interface.  It is needed to
construct options like -rpath-link so that the linker can find
runtime dependencies of a shared library when linking it into
another target.

This is clearly described in the docs:

 http://www.cmake.org/cmake/help/v2.8.10/cmake.html#prop_tgt:IMPORTED_LINK_DEPENDENT_LIBRARIES

If you want transitive linking on imported targets then the right
property is IMPORTED_LINK_INTERFACE_LIBRARIES no matter the type
of library.

-Brad


More information about the CMake mailing list