[cmake-developers] Policy for INTERFACE_LINK_LIBRARIES

Stephen Kelly steveire at gmail.com
Mon Dec 3 11:23:28 EST 2012


Brad King wrote:

> On 12/03/2012 10:06 AM, Stephen Kelly wrote:
>> Brad King wrote:
>>> The CONFIG_DEBUG property complements the "debug" keyword in tll().
>>> That's all it does, and it exactly matches the behavior we need in
>>> the motivating case.  Something like $<COMPATIBLE_CONFIG:cfg> may
>>> be useful but that can be added in the future in another topic.
>> 
>> Yes, it could be added in the future, but the generator expression added
>> by generatorIface could not then be ported to use it (after a release is
>> made with this patch in it) without breaking behavior backward
>> compatibility.
> 
> The purpose of the generatorIface logic is to implement the "debug"
> keyword from tll() with a generator expression.  It doesn't make sense
> to generalize the test that keyword performs because ideally in the future
> no one will use this keyword anymore and will use generator expressions
> instead.

Yes, you're right. CONFIG_DEBUG is fine then.

> 
>>> When constructing a topic pretend that each commit is the last commit
>>> you will ever make to CMake, without the rest of the topic after it,
>>> or at least without future topics.  If it doesn't make sense to leave
>>> it off at that point then the commits are organized incorrectly and
>>> therefore harder to review.
> 
> Perhaps better wording for the above: We can't put any topics in master
> that depend on future topics for completeness.
> 
>> That would mean that add-INTERFACE_LINK_LIBRARIES-property should also
>> include the rest of the commits to add the LINK_LIBRARIES property and
>> use that for static libraries to generate the INTERFACE_LINK_LIBRARIES
>> property on exported targets. Otherwise
>> add-INTERFACE_LINK_LIBRARIES-property topic would be introducing a bug.
> 
> ...but that behavior is not influenced by the new policy CMP0019.
> Currently this topic will just generate the old properties named
> IMPORTED_LINK_INTERFACE_LIBRARIES(_<CONFIG>) for static libs and
> everything will work, no?

I'm not certain. If the policy is NEW and I export a static library, then 
only IMPORTED_LINK_INTERFACE_LIBRARIES(_<CONFIG>) will be on the generated 
IMPORTED targets (as is my understanding - I have not tried this).

If I then try to use that IMPORTED target, the 
IMPORTED_LINK_INTERFACE_LIBRARIES(_<CONFIG>) will be ignored, and the 
INTERFACE_LINK_LIBRARIES will also not give me anything useful (because it 
does not exist, despite upstream using CMP0019 == NEW), though it would be 
populated in a future CMake release.

Am I missing anything there?

Thanks,

Steve.





More information about the cmake-developers mailing list