[CMake] Does the echo command use the system shell?

Rolf Eike Beer eike at sf-mail.de
Wed Jul 28 14:31:32 EDT 2010


Am Wednesday 28 July 2010 schrieb Óscar Fuentes:
> Eric Noulard
<eric.noulard at gmail.com>
> writes:
> 
> [snip]
> 
> > if you need build
> >
time creation of the file then you may write a CMake script
> >
"generateMyFile.cmake" which contains such commands and use
> > 
> >
add_custom_command( ...
> > 
> >   COMMAND ${CMAKE_COMMAND} -P
generateMyFile.cmake
> >   
> >        ...)
> 
> That approach justs shifts
the problem to a separate cmake script, but
> it still remains.
> 
> The
task here is to write a literal string containing a "special"
> character
(#) to a file, at build time. For "cmake -E echo" it requires
>
platform-dependent escape sequences. My idea about the cmake -E commands
>
was that they purpose is to abstract platform differences, but seems
> that
that is not entirely correct, as they inherit some traits from the
>
underlying platform. Or is it a bug?

You do only need to escape things from
CMake's own file processor as this is started from within the CMake build
process. No need to call "cmake -E" at all.

Eike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100728/966d0dbc/attachment.pgp>


More information about the CMake mailing list