[CMake] generator expressions

Brad King brad.king at kitware.com
Fri Jun 6 11:43:07 EDT 2014


On 06/06/2014 11:37 AM, Andrew Fuller wrote:
> Should I be quoting all my generator expressions?
> Is that the proper syntax?

The CMake language does not actually know anything about generator
expressions.  They are just strings like any other command arguments
as far as it knows.  See the command argument syntax documentation
here:

 http://www.cmake.org/cmake/help/v3.0/manual/cmake-language.7.html#command-arguments

In order to ensure the command receives a generator expression in
its entirety it should be double-quoted if it contains any literal
spaces or ${var} evaluations that may have ; in them.  Otherwise
it is not necessary to quote and sometimes looks nicer not to.  It
is always safe to quote generator expressions though.

-Brad



More information about the CMake mailing list