[cmake-developers] output expressions fails with either a build.ninja error or wrong escaped space

Brad King brad.king at kitware.com
Tue May 31 14:51:12 EDT 2016


On 05/31/2016 02:28 PM, jerry.c.t at web.de wrote:
> thanks for the response. I was eager to solve this. I came up 
> with this solution:
>  
> -I$<JOIN:$<TARGET_PROPERTY:dummy,INCLUDE_DIRECTORIES>,\t-I>
>  
> I searched for a solution where i can use it without the quotes
> while the tab (\t) takes care that it is recognized as a generator
> expression. Now my command line looks a little bit odd with all these
> tabs but it works.
> 
> So i simply wonder whether it is possible to add to cmake 
> something like \s for a space.

One can already escape a space with `\ `, but it won't help you.

The only reason your `\t` hack works is because the incomplete
escaping performed by generators for add_custom_{command,target}
without the VERBATIM option does not consider TABs to need quoting.
Without that option, other needed quoting or escaping may not work.

There is no officially supported way to do what you're trying to do.
If you find a hack that happens to work due to implementation details
of the current version of CMake, there is no guarantee they will work
in future versions.  Please see my previous response for a supported
alternative approach.

-Brad



More information about the cmake-developers mailing list