[cmake-developers] CMake 2.8.12 transitive link regression?
Brad King
brad.king at kitware.com
Fri Nov 1 08:49:53 EDT 2013
On 11/01/2013 07:32 AM, Stephen Kelly wrote:
> Your commit, and my follow up from today don't pass this test:
In your follow up, you removed my hunk:
- // Make sure INTERFACE_LINK_LIBRARIES target property exists
- // if any signature except the plain one was used. Other
- // signatures imply awareness of explicit link interfaces.
- if(this->CurrentProcessingState != ProcessingLinkLibraries &&
- !this->Target->GetProperty("INTERFACE_LINK_LIBRARIES"))
- {
- this->Target->SetProperty("INTERFACE_LINK_LIBRARIES", "");
- }
What is wrong with it? The documentation of the tll signatures
besides the plain one says that they set INTERFACE_LINK_LIBRARIES.
Shouldn't it get set to empty if a non-plain signature is used
that doesn't add anything to the interface?
> 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?
I think we should encourage use of the tll keyword signatures
in which case this doesn't matter. However, we can try to support
this. Perhaps the implementation of cmTarget::GetProperty can
special-case INTERFACE_LINK_LIBRARIES to return LINK_LIBRARIES
if only the plain tll signature was used. That will cover both
the export and generator expression cases, no?
-Brad
More information about the cmake-developers
mailing list