foreach( file ${files} )
ADD_CUSTOM_COMMAND(
...
COMMAND cpp -P -CC -DDPI_EXTERN ${file} >>
${FILEEXTERN}.tmp \; done'
)




On Mon, Apr 28, 2014 at 9:05 AM, j s <[email protected]> wrote:

> Through trial and error, I've found that I can do the following to
> escape a variable in a custom command.
>
> ADD_CUSTOM_COMMAND(
> ...
> COMMAND bash -c 'for i in ${FILES}\; do cpp -P -CC -DDPI_EXTERN $$i >>
> ${FILEEXTERN}.tmp \; done'
>
> ...
> )
>
>
> Is this the proper way to escape a variable that needs to make to the
> shell command level?  I'm assuming this would only work through a Unix
> Makefile?  Is there an alternative to iterating over a variable in a
> custom command?
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to