[cmake-developers] Policy for INTERFACE_LINK_LIBRARIES

Stephen Kelly steveire at gmail.com
Thu Nov 29 16:35:48 EST 2012


Brad King wrote:

> On 11/28/2012 05:15 PM, Stephen Kelly wrote:
>>> I think we can drop the consumer-side policy completely.  Consumers will
>>> load imported targets with the old and/or new interfaces specified as
>>> chosen by the
>>> producing project.
>>>
>>> CMake < 2.8.11 will just use the old interface.  CMake
>>>> = 2.8.11 will just use the new interface if it is available and
>>>> otherwise
>>> fall
>>> back to the old.  The burden of compatibility with existing consumer
>>> releases falls on the authors modifying the producing project, just as
>>> with any other change they make.
>> 
>> Yes.
> 
> Your revised commit:
> 
>  http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8f77e068
> 
> still does more than the above.  ComputeImportInfo should not
> check the policy at all because IMPORTED targets are always
> consumer-side.
> 

<snip>

I've pushed add-INTERFACE_LINK_LIBRARIES-property to my gitorious clone. Is 
that what you meant?

> 
> BTW, how do you plan to handle other parts of the link interface:
> 
>  - IMPORTED_LINK_INTERFACE_MULTIPLICITY
>  - IMPORTED_LINK_INTERFACE_LANGUAGES
>  - IMPORTED_LINK_DEPENDENT_LIBRARIES
> 

So far I haven't seen a reason to replace them, but I think it would be 
possible using the same logic (and even the same policy, if the patch is 
done before 2.8.11) as is used for IMPORTED_LINK_INTERFACE_LIBRARIES to do 
so.

I guess a reason to replace them would be to be able to use the $<CONFIG> 
generator expression in them.

Is IMPORTED_LINK_DEPENDENT_LIBRARIES different from the others? It doesn't 
have INTERFACE in the name. I haven't used it before either, but from the 
documentation, it looks like it should be automatically populated by 
target_link_libraries(foo LINK_PRIVATE bar) and similar?


> Other comments on the commit ignoring the above discussion:
> 
> - The documentation is missing a period at the end of the NEW behavior
>   sentence.  Also "the (IMPORTED_)?LINK_INTERFACE_LIBRARIES(_<CONFIG>)?
>   properties" would be better worded as "properties matching ..." to
>   make it clear that the string is a regex for human reference.
> 
> - One CMP0019 warning hard-codes "LINK_INTERFACE_LIBRARIES" instead of
>   the possible "LINK_INTERFACE_LIBRARIES_<CONFIG>" name.
> 
> Some documentation appears missing:
> 
> - Generator expressions BUILD_INTERFACE, INSTALL_INTERFACE, and
>   EXPORT_NAMESPACE.
> 
> - Target property INTERFACE_LINK_LIBRARIES.


I've also pushed a docs commit to my gitorious clone. Please let me know if 
I can push-merge-rewrite-push-merge that branch. Then I'll rebase the other 
two topics too.

Thanks,

Steve.





More information about the cmake-developers mailing list