[cmake-developers] Policy for INTERFACE_LINK_LIBRARIES

Brad King brad.king at kitware.com
Thu Nov 29 13:42:22 EST 2012


On 11/28/2012 05:15 PM, Stephen Kelly wrote:
> I guess the old interface is not exported if it is unset, so if the producer 
> stops populating the old interface, they stop exporting it too. The problem 
> is we'd need to provide a way for them to not populate the old interface.

Yes.

> Having them port away from 
> 
>  set_property(TARGET foo PROPERTY LINK_INTERFACE_LIBRARIES_DEBUG bar)
> 
> is obvious, but what is not so obvious is that 
> 
>  target_link_libraries(foo LINK_INTERFACE_LIBRARIES bar)

IMO both of the above are obvious because the name matches.

>  target_link_libraries(foo LINK_PUBLIC bar)
> 
> also populate that property and cause the old interface to be exported. That 
> would be a mystery to someone who doesn't want to export the old interface 
> anymore.
> 
> Maybe we can deprecate those (and introduce a warning on export if the 
> policy is NEW) and introduce 
> 
>  target_link_libraries(foo INTERFACE bar)
>  target_link_libraries(foo PRIVATE bar)
>  target_link_libraries(foo PUBLIC bar)

We _just_ added LINK_PUBLIC/LINK_PRIVATE.  I'd rather not flip
interfaces around too much here.  Perhaps part of the NEW
behavior of CMP0019 can be that LINK_PUBLIC/LINK_PRIVATE do
not populate the old interface.  Anyone that wants to provide
both interfaces can set the policy to NEW and then set the
old interface explicitly.

-Brad



More information about the cmake-developers mailing list