Thanks Tyler, that works indeed. It seems very obvious now actually. For people reading this thread in the archive, the following works:<br><br>SET( sources s1.cpp s2.cpp s3.cpp )<br>SET( arguments -c1 2 )<br>LIST( APPEND arguments ${sources} )        <br>
ADD_CUSTOM_COMMAND( TARGET test<br>                                           PRE_BUILD<br>                                           COMMAND &quot;../test.py&quot; ${arguments} )<br><br>Iman<br><br><div class="gmail_quote">
On Mon, Jun 1, 2009 at 4:47 PM, Tyler Roscoe <span dir="ltr">&lt;<a href="mailto:tyler@cryptio.net">tyler@cryptio.net</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">On Mon, Jun 01, 2009 at 04:31:33PM -0400, Iman Brouwer wrote:<br>
&gt; #Add the source files<br>
&gt; FOREACH( cpp ${sources } )<br>
&gt;     SET( arguments &quot;${arguments} ${cpp}&quot; )<br>
&gt; ENDFOREACH( cpp )<br>
&gt; add_custom_command( TARGET test COMMAND &quot;script.py&quot; &quot;${arguments}&quot; )<br>
<br>
</div>I think that will work if you get rid of the &quot;&quot; around ${arguments}.<br>
<br>
You also might want to look at the VERBATIM parameter to<br>
add_custom_command().<br>
<font color="#888888"><br>
tyler<br>
</font></blockquote></div><br>