[CMake] -E echo doen't handle apostrophes

Brandon J. Van Every bvanevery at gmail.com
Thu Jul 20 15:07:01 EDT 2006


Using CMake 2.4.2.  Here's my mighty CMakeLists.txt:

ADD_CUSTOM_TARGET(test
  COMMAND ${CMAKE_COMMAND} -E echo "It's difficult to handle apostrophes."
)

I used CCMake under Cygwin to generate the Makefile.  It dies thus:

Brandon J. Van Every at kahlo ~/echo
$ make test
/bin/sh: -c: line 0: unexpected EOF while looking for matching `''
/bin/sh: -c: line 1: syntax error: unexpected end of file
make[3]: *** [test] Error 2
make[2]: *** [CMakeFiles/test.dir/all] Error 2
make[1]: *** [CMakeFiles/test.dir/rule] Error 2
make: *** [test] Error 2

Using CMakeSetup and MSYS generator, then running under an MSYS shell, 
it dies thus:

Brandon J. Van Every at KAHLO ~/msys/echo
$ make test
/bin/sh: -c: line 1: unexpected EOF while looking for matching `''
/bin/sh: -c: line 2: syntax error: unexpected end of file
make[3]: *** [test] Error 2
make[2]: *** [CMakeFiles/test.dir/all] Error 2
make[1]: *** [CMakeFiles/test.dir/rule] Error 2
make: *** [test] Error 2

It works fine under the Visual Studio .NET 2003 generator, but of course 
that's no shocker, as /bin/sh isn't invoked.

I didn't test the MinGW generator because I currently have /bin/sh in my 
path, and it wisely warned me of my foible.  I don't feel like 
reconfiguring my build environment.


Cheers,
Brandon Van Every




More information about the CMake mailing list