Ah I forgot to say also...<br><br>I cant put the whole command line in quotes, otherwise the add_custom_target tells me<br>&quot;/bin/sh : command not found &quot;&lt;whole command line including parameters....&gt; &quot;<br>
<br>so I need to separate the command executable and its parameter, but then the command gets parameters with quotes and fails...<br><br>---<br>AlexV ... puzzled...<br><br><div class="gmail_quote">2009/8/6 Asmodehn Shade <span dir="ltr">&lt;<a href="mailto:asmodehn@gmail.com">asmodehn@gmail.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi everyone,<br><br>Sorry if this has been answered before, but google doesnt give me anything useful...<br>
<br>Lets say I have a list of source files : SOURCES holds : filea.c;fileb.c<br>I want to pass them to an external program ( Astyle for example ) so I need to have a whitespace separated list <br>
<br>there fore I use the trick here which gives me the correct solution : <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 : &quot;filea.c fileb.c&quot;<br><br>however now I want to use that in a custom target  : <br>ADD_CUSTOM_TARGET(format ALL ${ASTYLE_EXECUTABLE} --style=ansi ${SPACES_SOURCES} VERBATIM )<br>

<br>Problem is that the command generated by cmake still includes the  double quotes.<br>therefore : astyle --style=ansi &quot;filea.c fileb.c&quot; doesnt work ( expects one file with a space in the name )<br><br>I cant even use a first shell to evaluate those because cmake would escape the single reverse quotes :<br>

astyle --style=ansi \` echo &quot;filea.c fileb.c&quot;\`<br>which is the exact opposite of what I want...<br><br>Any idea anyone ? I guess I must be missing something obvious here, but this has troubled me for a while now...<br>

<br>Thanks a lot !<br><font color="#888888"><br>--<br>Alex<br><br>
</font></blockquote></div><br>