Thanks Tyler, that works indeed. It seems very obvious now actually. For people reading this thread in the archive, the following works:
SET( sources s1.cpp s2.cpp s3.cpp ) SET( arguments -c1 2 ) LIST( APPEND arguments ${sources} ) ADD_CUSTOM_COMMAND( TARGET test PRE_BUILD COMMAND "../test.py" ${arguments} ) Iman On Mon, Jun 1, 2009 at 4:47 PM, Tyler Roscoe <ty...@cryptio.net> wrote: > On Mon, Jun 01, 2009 at 04:31:33PM -0400, Iman Brouwer wrote: > > #Add the source files > > FOREACH( cpp ${sources } ) > > SET( arguments "${arguments} ${cpp}" ) > > ENDFOREACH( cpp ) > > add_custom_command( TARGET test COMMAND "script.py" "${arguments}" ) > > I think that will work if you get rid of the "" around ${arguments}. > > You also might want to look at the VERBATIM parameter to > add_custom_command(). > > tyler >
_______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake