file(WRITE) changes EOL on Windows.
If I run
file(READ input.txt input)
file(WRITE output.txt "${input}")
Output.txt
is created with CRLF EOL on Windows, even though input.txt
uses LF EOL. Haven't tested on MacOS, but presumably the same issue is present.
NEWLINE_STYLE
option is needed here.