[CMake] Tricky problem with variable, whitespace, quotes and shell
Tyler Roscoe
tyler at cryptio.net
Thu Aug 6 11:56:06 EDT 2009
On Thu, Aug 06, 2009 at 08:04:37PM +0900, Asmodehn Shade wrote:
> there fore I use the trick here which gives me the correct solution :
> http://www.vtk.org/Wiki/CMake_FAQ#How_to_convert_a_semicolon_separated_list_to_a_whitespace_separated_string.3F
>
> So now SPACES_SOURCES holds : "filea.c fileb.c"
>
> however now I want to use that in a custom target :
> ADD_CUSTOM_TARGET(format ALL ${ASTYLE_EXECUTABLE} --style=ansi
> ${SPACES_SOURCES} VERBATIM )
>
> Problem is that the command generated by cmake still includes the double
> quotes.
> therefore : astyle --style=ansi "filea.c fileb.c" doesnt work ( expects one
> file with a space in the name )
Are you somehow introducing the quotes to SPACES_SOURCES while doing the
list expansion? ${ASTYLE_EXECUTABLE} doesn't have the same problem, so
I'm guessing you got them in there somehow.
tyler
More information about the CMake
mailing list