[cmake-developers] Issues with generator expressions and lists

Stephen Kelly steveire at gmail.com
Thu Feb 28 11:37:13 EST 2013


Brad King wrote:

> On 02/27/2013 01:24 PM, Brad King wrote:
>> The argument splitting rule should remain simple: a quoted
>> argument is one value and an unquoted argument expands on ";".

I didn't realize it before, but this seems to already be the case, right (in 
a world without genexes)?

 set(COMMARGS one two\\;three "four\\;five")

 add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/output.cpp
                    COMMAND echo
                    ARGS ${COMMARGS} six seven\\;eight "nine\\;ten"
                    VERBATIM
 )

gives 

 echo one two three "four;five" six "seven;eight" "nine\\;ten"

>> What your topic needs to do is delay the expansion for unquoted
>> generator expressions from configure to generate time.
> 
> While I think this should be the plan moving forward, I do
> not think we should try to address it before 2.8.11.  It will
> be a change in argument parsing handling.  Without preservation
> of ';' in unquoted generator expressions they will not be
> recognized as generator expressions so the behavior will be
> no different from the same arguments in 2.8.10.  Therefore
> we can introduce the argument parsing change later to introduce
> a new feature of allowing unquoted generator expressions that
> contain lists to be expanded at generate time.

Yes, fair enough. I wonder if there are bugs in the use of eg $<1:foo,bar> 
with COMMANDs, but if there are, they're already in 2.8.10.2 anyway.

> Your "Consider a genex as a single command arg" commit changes
> argument splitting to not use ExpandListArgument but
> cmGeneratorExpression::Split does not behave the same for all
> values.  The original ExpandListArgument also preserves ";"
> inside [] blocks (added so that the registry entry syntax would
> continue to work for unquoted arguments; too late to change now).

I don't think it handles foo\\;bar either. That's probably something which 
should be fixed. There shouldn't be any situation where ExpandListArgument 
can be used but genex::Split can't be.

Thanks,

Steve.





More information about the cmake-developers mailing list