<div dir="ltr"><div><span style="font-family:arial,sans-serif;font-size:13px">foreach( file ${files} )</span></div><span style="font-family:arial,sans-serif;font-size:13px">ADD_CUSTOM_COMMAND(</span><br style="font-family:arial,sans-serif;font-size:13px">
<span style="font-family:arial,sans-serif;font-size:13px">...</span><br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">COMMAND cpp -P -CC -DDPI_EXTERN ${file} >></span><br style="font-family:arial,sans-serif;font-size:13px">
<span style="font-family:arial,sans-serif;font-size:13px">${FILEEXTERN}.tmp \; done'</span><br style="font-family:arial,sans-serif;font-size:13px">)<div><br><br style="font-family:arial,sans-serif;font-size:13px"></div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Apr 28, 2014 at 9:05 AM, j s <span dir="ltr"><<a href="mailto:j.s4403@gmail.com" target="_blank">j.s4403@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Through trial and error, I've found that I can do the following to<br>
escape a variable in a custom command.<br>
<br>
ADD_CUSTOM_COMMAND(<br>
...<br>
COMMAND bash -c 'for i in ${FILES}\; do cpp -P -CC -DDPI_EXTERN $$i >><br>
${FILEEXTERN}.tmp \; done'<br>
<br>
...<br>
)<br>
<br>
<br>
Is this the proper way to escape a variable that needs to make to the<br>
shell command level? Â I'm assuming this would only work through a Unix<br>
Makefile? Â Is there an alternative to iterating over a variable in a<br>
custom command?<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://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
</blockquote></div><br></div>