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

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Reply via email to