<br><div class="gmail_quote">Well I need to have the quotes in there to keep the space in between the filenames, otherwise they all get replaced by a ";" semi colon, as per cmake behaviour to set a list ( cmake list are ";" separated )<br>
<br>Anyway it seems I managed to work around the problem by adding another level of shell :<br><br>First I put the whole command in quotes :<br>SET( cmdline "${ASTYLE_EXECUTABLE} --style=ansi ${SPACES_SOURCES}")<br>
this way the quotes around the sources filenames disappear... eaten by the quotes for the whole string<br><br>Then I add my custom target :<br>ADD_CUSTOM_TARGET(format ALL sh -c ${cmdline} VERBATIM )<br>the sh -c runs another shell who can now evaluate the command in quotes completely without being annoyed by the quotes in there...<br>
<br>Seems to work fine so far...<br><br>Hope this post will be useful to others ;-)<br><br>--<br>AlexV<br><br><div class="gmail_quote">2009/8/7 Tyler Roscoe <span dir="ltr"><<a href="mailto:tyler@cryptio.net" target="_blank">tyler@cryptio.net</a>></span><div>
<div></div><div class="h5"><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div>On Thu, Aug 06, 2009 at 08:04:37PM +0900, Asmodehn Shade wrote:<br>
> there fore I use the trick here which gives me the correct solution :<br>
> <a href="http://www.vtk.org/Wiki/CMake_FAQ#How_to_convert_a_semicolon_separated_list_to_a_whitespace_separated_string.3F" target="_blank">http://www.vtk.org/Wiki/CMake_FAQ#How_to_convert_a_semicolon_separated_list_to_a_whitespace_separated_string.3F</a><br>
><br>
> So now SPACES_SOURCES holds : "filea.c fileb.c"<br>
><br>
> however now I want to use that in a custom target :<br>
> ADD_CUSTOM_TARGET(format ALL ${ASTYLE_EXECUTABLE} --style=ansi<br>
> ${SPACES_SOURCES} VERBATIM )<br>
><br>
> Problem is that the command generated by cmake still includes the double<br>
> quotes.<br>
> therefore : astyle --style=ansi "filea.c fileb.c" doesnt work ( expects one<br>
> file with a space in the name )<br>
<br>
</div>Are you somehow introducing the quotes to SPACES_SOURCES while doing the<br>
list expansion? ${ASTYLE_EXECUTABLE} doesn't have the same problem, so<br>
I'm guessing you got them in there somehow.<br>
<font color="#888888"><br>
tyler<br>
</font></blockquote></div></div></div><br>
</div><br>