[CMake] INSTALL(EXPORT) does not honor LINK_INTERFACE_LIBRARIES?

Brad King brad.king at kitware.com
Tue Mar 29 09:41:36 EDT 2011


On 03/29/2011 05:19 AM, Rolf Eike Beer wrote:
> The basic idea is: any symbols from those private libraries are, well,
> private. The user only ever sees the symbols from the public library. In
> fact he _can't_ even link to the private libraries on Windows as we never
> install the .lib files. And that's no problem at all as we already link to
> everything we need. I'm using --as-needed and --no-undefined on Un*x and
> see no problem there either.
> 
> So the point is I want CMake to stop telling the user that he needs to
> those private libraries as that's simply not true.

As Michael pointed out it is needed to set this property:

  http://www.cmake.org/cmake/help/cmake-2-8-docs.html#prop_tgt:IMPORTED_LINK_DEPENDENT_LIBRARIES

CMake running in an outside application needs to know these private runtime
dependencies.  It needs them ensure that the application link line is generated
such that the linker can find the transitive dependencies (e.g. -rpath-link)
of the public library.

-Brad


More information about the CMake mailing list