[cmake-developers] Setting the link interface and dependencies in one command

Brad King brad.king at kitware.com
Fri Oct 7 08:36:33 EDT 2011


On 10/6/2011 8:01 PM, Stephen Kelly wrote:
> Do you mean a library or target called LINK_INTERFACE_DEPENDENCIES? Or do
> you mean like this:
>
>    target_link_libraries(somelib ${ARGS_FROM_SOMEWHERE_ELSE})
>
> where the variable could be a list containing the term
> LINK_INTERFACE_DEPENDENCIES?

The latter.

>>     target_link_libraries(foo LINK_INTERFACE bar LINK_DEPENDS baz)
>
> Is this also succeptable to the same
>
>    target_link_libraries(somelib ${ARGS_FROM_SOMEWHERE_ELSE})
>
> effect?

Yes, but I think it will be harder to do by accident.  I just don't
want something like

   target_link_libraries(somelib lib1 lib2 ${OTHER_LIBS})

to invisibly change based on OTHER_LIBS.  I think the new signature
will be more commonly used explicitly:

   target_link_libraries(somelib LINK_PRIVATE lib1
                                  LINK_PUBLIC lib2 ${OTHER_LIBS})

-Brad



More information about the cmake-developers mailing list