On 2012-10-31 19:34, Alan W. Irwin wrote:
After a lot of thrashing around I finally discovered that

file(WRITE <filename> "\$""'""\\r""'")

worked to write the literal string

$'\r'

to a file, i.e, so that the od -a result was

$   '   \   r   '

Is there an easier way to write this literal string to a file that I
missed?

file(WRITE <filename> "\$'\\r'")?

You're not going to get much simpler, as both '\' and '$' have special meaning and so need to be escaped.

I'm not sure why you found it necessary to add all the extra quotes?

(Tested on cmake 2.8.9 on Linux.)

--
Matthew

--

Powered by www.kitware.com

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

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

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

Reply via email to