[cmake-developers] CMake 2.8.12 transitive link regression?

Stephen Kelly steveire at gmail.com
Fri Nov 1 07:32:20 EDT 2013


Brad King wrote:

> Can you explain what the comment about LINK_LIBRARIES means?

The comment carried the (now known to be mistaken) assumption that the 
implementation is only ever the interface if CMP0022 is OLD.

If it is NEW, then the INTERFACE_LINK_LIBRARIES defines the link interface 
(exclusively and always, as the assumption went), and as the preceeding 
if(explicitLibraries) was not entered, it was not set, and therefore there 
is no link interface at all.

> It is the logic here that needs to trigger regardless of the CMP0022
> setting, and then the export logic must deal with the case that the
> implementation is the interface both for populating the new and
> old interface properties.

Your commit, and my follow up from today don't pass this test:
 
 add_library(foo SHARED foo.cpp)
 add_library(bar SHARED foo.cpp)
 # target_link_libraries(foo bar)
 set_property(TARGET foo PROPERTY LINK_LIBRARIES bar)
 file(GENERATE OUTPUT outputfile 
   CONTENT "$<TARGET_PROPERTY:foo,INTERFACE_LINK_LIBRARIES>\n")
 # Expect outputfile to contain 'bar', but it does not.


That was a primary motivation for introducing INTERFACE_LINK_LIBRARIES.

So, I guess we should add something similar to the export logic to the genex 
TargetPropertyNode. Any comments on that?

Thanks,

Steve.





More information about the cmake-developers mailing list