Re: [CMake] How to use file(WRITE... to write the literal string $'\r' to a file

2012-11-01 Thread Alan W. Irwin
On 2012-10-31 20:24-0400 David Cole wrote: This works for me: file(WRITE "w.txt" "$'\\r'") and Matthew came to a similar conclusion. Thanks to both of you for this suggested simplification which also works here for me. Alan __ Alan W. Irwin Astronomical research aff

Re: [CMake] How to use file(WRITE... to write the literal string $'\r' to a file

2012-10-31 Thread David Cole
The only character you need to escape in the whole sequence is the backslash. You only have to escape a $ if it precedes a { to disambiguate from a variable dereference. This works for me: $ cat w.cmake file(WRITE "w.txt" "$'\\r'") $ cmake -P w.cmake $ cat w.txt $'\r' HTH, David On Wed, Oc

Re: [CMake] How to use file(WRITE... to write the literal string $'\r' to a file

2012-10-31 Thread Matthew Woehlke
On 2012-10-31 19:34, Alan W. Irwin wrote: After a lot of thrashing around I finally discovered that file(WRITE "\$""'""\\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 f

[CMake] How to use file(WRITE... to write the literal string $'\r' to a file

2012-10-31 Thread Alan W. Irwin
After a lot of thrashing around I finally discovered that file(WRITE "\$""'""\\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? Alan __