<div dir="ltr"><div>I think it should work if you put quotes around the expansion - otherwise, an empty variable expands to nothing, not to an empty string:<br><br><b>add_custom_command(<br></b><div><b>    OUTPUT ${some_files}<br>
</b></div><div><b>    COMMAND ${PYTHON_EXECUTABLE} test.py "${prefix}" ${src} ${dst}<br></b></div><div class="im">
<div><b>    DEPENDS ${....... all deps ......} )</b></div></div><br></div>Petr<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jun 30, 2014 at 1:13 PM, abid rahman <span dir="ltr"><<a href="mailto:abidrahman2@gmail.com" target="_blank">abidrahman2@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Thank you Nils, VERBATIM really worked for me as shown below:<br><br><div><b>add_custom_command(<br>
</b></div><div><b>    OUTPUT ${some_files}<br></b></div><div class=""><div><b>    COMMAND ${PYTHON_EXECUTABLE} test.py "" ${src} ${dst}<br>

</b></div>
</div><div class=""><div><b>    DEPENDS ${....... all deps ......}<br></b></div></div><div><b>    VERBATIM )</b></div><br></div>But now got a new question. I tried setting a variable and passing it, but it didn't work. as shown below:<br>
<br>

<div><b>set(prefix "")<br>add_custom_command(<br></b></div><div><b>    OUTPUT ${some_files}<br></b></div><div><b>    COMMAND ${PYTHON_EXECUTABLE} test.py ${prefix} ${src} ${dst}<br></b></div><div class="">
<div><b>    DEPENDS ${....... all deps ......} )</b></div><br></div></div>Any idea why?<br></div><div class="gmail_extra"><br clear="all"><div><div dir="ltr">Abid K.</div></div><div class="">
<br><br><div class="gmail_quote">On Mon, Jun 30, 2014 at 1:35 PM, Nils Gladitz <span dir="ltr"><<a href="mailto:nilsgladitz@gmail.com" target="_blank">nilsgladitz@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


<div>On 06/30/2014 09:42 AM, abid rahman wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>
Hello,<br>
<br>
I need to execute following  command with add_custom_command:<br></div>
*python test.py "" src dst*<div><br>
<br>
The first argument is empty. Sometimes it may have some text. So Python<br>
process the args as [test.py, "", src, dst]. But when I do the same with<br>
add_custom_command, the empty argument is not considered, instead src is<br>
considered as second argument.<br>
<br>
I did it as follows:<br>
<br></div>
*add_custom_command(<br>
*<br>
*    OUTPUT ${some_files}<br>
*<br>
*    COMMAND ${PYTHON_EXECUTABLE} test.py "" ${src} ${dst}<br>
*<br>
*    DEPENDS ${....... all deps ......} )*<div><br>
<br>
So what is the best method to pass empty arguments to cmake<br>
add_custom_command?<br>
Abid K.<br>
</div></blockquote>
<br>
Try adding VERBATIM.<span><font color="#888888"><br>
<br>
Nils<br>
<br>
</font></span></blockquote></div><br></div></div>
<br>--<br>
<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
<br>
CMake Support: <a href="http://cmake.org/cmake/help/support.html" target="_blank">http://cmake.org/cmake/help/support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" target="_blank">http://cmake.org/cmake/help/training.html</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/cmake" target="_blank">http://public.kitware.com/mailman/listinfo/cmake</a><br></blockquote></div><br></div>