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

Stephen Kelly steveire at gmail.com
Wed Oct 5 09:47:08 EDT 2011


Brad King wrote:

> On 10/4/2011 10:22 PM, Stephen Kelly wrote:
>> 1) Change the meaning of LINK_INTERFACE_LIBRARIES in
>>
>> set_target_properties(foo LINK_INTERFACE_LIBRARIES bar)
> 
> Do you mean target_link_libraries, rather than set_target_properties?
> The latter is a very general command and will not be taught special
> behavior for certain properties.  I'm assuming you mean
> 
>    target_link_libraries(foo LINK_INTERFACE_LIBRARIES bar)

Yes, you are correct. Thanks for the clarification.

<snip>

> 
>> 2) Introduce another variable for doing the same thing as above.
> 
> s/variable/keyword argument to target_link_libraries/

<snip>

> 
>> My preference is (1).
> 
> We need to use (2) with a well-chosen name.
> 

Thanks for all of your explanations. It seems that introducing a way to do 
this with one command has some support.

So if SOME_FEATURE is true,

target_link_libraries(foo bar SOME_KEYWORD baz)
if (SOME_FEATURE)
  target_link_libraries(foo mar SOME_KEYWORD maz)
endif()

would have to result in bar and mar not being part of the link interface, 
and baz and maz being part of the link interface.

How do we decide on a keyword there? LINK_INTERFACE_DEPENDENCIES perhaps?

All the best,

Steve.





More information about the cmake-developers mailing list