[CMake] [ANNOUNCE] CMake 3.1.0-rc1 now ready for testing!

Brad King brad.king at kitware.com
Thu Oct 30 13:28:06 EDT 2014


On 10/30/2014 12:22 PM, Robert Dailey wrote:
> Why are quotations required for generator expressions using lists now?

It is not a new requirement.  This has always been the case.  It was
just that between 2.8.12 and 3.0 an idiosyncrasy of the implementation
changes accidentally removed the requirement specifically for expressions
given to target_link_libraries (to put in the LINK_LIBRARIES properties).
Quotes were still required in 3.0 for generator expressions with lists
in other contexts.  Dropping it for LINK_LIBRARIES was accidental.

Further development between 3.0 and 3.1 did some internal refactoring
and optimization that takes advantage of the requirement and therefore
restored it in the LINK_LIBRARIES case where it never should have been
dropped.

> Is there a technical reason for it? I think it's intuitive that it
> worked without them.

You need to pass the entire expression with the list it contains as
a single argument to whatever command you're calling.  Otherwise the
unquoted argument will divide the expression on the ;s in it and
pass them as separate arguments to the command.  Then no one argument
is a complete expression.  The 3.1 release notes show an example of
this.

-Brad



More information about the CMake mailing list