[cmake-developers] Adding the OpenRAVE library module

Brad King brad.king at kitware.com
Wed Apr 27 08:10:05 EDT 2011


On 04/26/2011 08:52 PM, Rosen Diankov wrote:
> i'm not comfortable with managing all the dynamic libraries and putting
> them into LINK_INTERFACE_LIBRARIES.
> OpenRAVE contains a lot of 3rdparty libraries stored in source in case
> users don't have the system install versions

The distinction for LINK_INTERFACE_LIBRARIES is not whether the listed
libraries are static or shared, it's whether or not they are part of
your library's public interface.  When I include a header from your
library, what libraries do I need to link in addition to the main lib?
The answer determines what goes in LINK_INTERFACE_LIBRARIES.  CMake has
no way to know this information.  That's why you need to set the property.

If your library links against a third-party dependency that is not part
of your interface then don't list it in LINK_INTERFACE_LIBRARIES whether
it is shared or not.  If it is shared CMake will keep it in a separate
IMPORTED_LINK_DEPENDENT_LIBRARIES property set on the exported target
to construct the proper information for the application's linker to
find the dependency at link time.

-Brad



More information about the cmake-developers mailing list