[cmake-developers] Setting includes, defines and other usage requirements with one command

Stephen Kelly steveire at gmail.com
Thu Jan 31 10:23:00 EST 2013


Brad King wrote:
>> I've made the LINKED generator expression a first-class expression, not
>> just something to be preprocessed away. I think this addresses much of
>> the cost concern.
> 
> Nice!  Here are a few comments:
> 
> * I got a warning while building your branch:
> 
>  .../Source/cmExportFileGenerator.cxx: In member function ‘void
>  cmExportFileGenerator::ResolveTargetsInGeneratorExpression(std::string&,
>  cmTarget*, std::vector<std::basic_string<char> >&)’:
>  .../Source/cmExportFileGenerator.cxx:425:12: warning: unused variable
>  ‘error’ [-Wunused-variable]

Fixed now, thanks.

> 
> * I think $<LINKED:...> can be removed completely on export.

Yes, it can be. What you describe below was my initial implementation, and I 
can change it back to that. 

I left it as $<LINKED> so far so that it is a shorter string, and because 
the implementation is somewhat simpler.

I've pushed another patch doing the replacement. 

> If the
>   item is not a target then remove it (already done in your impl).
>   If it is a target then replace it with the appropriate
>   $<TARGET_PROPERTY:...,...> reference in the export.  This way the
>   $<LINKED:...> expression lives only as long as needed.
> 
> * We could document $<LINKED:...> it as an internal implementation
>   detail subject to future changes.  It should never be written by
>   a project, only by tll.

Ok.

>   It is transformed properly on export.
>   I'd like to leave room for an alternative solution to out-of-order
>   target interfaces in the future.
> 
> * Can the INCLUDE_DIRETORIES and COMPILE_DEFINITIONS property avoid
>   $<LINKED:foo> references if foo is linked more than once?  Skip
>   appending it if the same reference already exists earlier.  In
>   the BEFORE case, prepend it and remove later instances.

Yes I'm sure that can be done. Do you think it needs to be done before 
merging to next? Anything else to do before merging it?

Thanks,

Steve.





More information about the cmake-developers mailing list