[cmake-developers] conditionals in generator expressions

Stephen Kelly steveire at gmail.com
Mon Sep 24 09:15:05 EDT 2012


Brad King wrote:
>> The only option I see that might work is to extend the undefined behavior
>> documentation of the LOCATION* properties to cover use of generator
>> expressions with link libraries, and then try to refactor/copy the code
>> out of cmTarget to cmGeneratorTarget to add the generator expressions
>> feature.
> 
> I think this limitation is perfectly acceptable.

Great, thanks.

>> I wonder if it would work to introduce generator expression capable
>> LINK_LIBRARIES and INTERFACE_LINK_LIBRARIES properties
> 
> In the long run I think target_link_libraries should be reworked to
> maintain a LINK_LIBRARIES target property, just as include_directories was
> switched
> to the INCLUDE_DIRECTORIES target property.  The LINK_LIBRARIES property
> would be the authoritative place and could be safely modified by other
> commands like set_property.

Yes. I also want to obsolete the IMPORTED_LINK_INTERFACE_LIBRARIES in favor 
of INTERFACE_LINK_LIBRARIES so that expressions such as 

 $<TARGET_PROPERTY:foo,INTERFACE_LINK_LIBRARIES>

work for every target, not just non-imported ones. I'm not really sure why 
the IMPORTED_ variants of those properties were created and whether they are 
really needed?

Thanks,

Steve.





More information about the cmake-developers mailing list