Hello, <br><br>I'm trying to pass multiple arguments to a python script. The last arguments are file names that are already in a cmake list (semicolon seperated string).<br>Is it possible to pass the elements in this list to the python script as separate arguments?<br>
<br>------------------<br>SET( sources s1.cpp s2.cpp s3.cpp )<br>SET( arguments "-c 2" )<br><br>#Add the source files<br>FOREACH( cpp ${sources } ) <br> SET( arguments "${arguments} ${cpp}" )<br>
ENDFOREACH( cpp )<br>add_custom_command( TARGET test COMMAND "script.py" "${arguments}" )<br>--------------------<br><br>The above cmake script will call script.py with the "-c 2 s1.cpp s2.cpp s3.cpp" as a single argument instead of 5 individual arguments<br>
<br>Manually typing them out as individual strings does solve the problem but would be impractical:<br>add_custom_command( TARGET test COMMAND "script.py" "-c" "5" "s1.cpp" "s2.cpp" )<br>
<br>Any help would be greatly appreciated,<br><br>Iman<br><br><br>