cmake -E server changes default linefeed style of configure_file(...) to LF
When configuring my project using Qt creator 4.3 on Windows 7 x64 (which now uses cmake -E server) all configure_file outputs switched from CRLF to LF line endings. However, if they are later regenerated (e.g. ninja RERUN_CMAKE, make cmake_check_build_system, etc), they switch back to CRLF as before. This causes unnecessary rebuilds and build outputs that differ depending on whether the built is from the IDE's initial setup or an incremental run.
If overridden with NEWLINE_STYLE they can still be forced to either type, but the fact that the default is now inconsistent from run to run seems undesirable.
This misbehavior appears to be caused by the bundled libuv, which is setting the (deprecated) _fmode = _O_BINARY
global variable
in MSVCRT (https://msdn.microsoft.com/en-us/library/ee2849wt.aspx) and thus changing the default behavior of all subsequent open calls process-wide. This is happening in uv_fs_init, which is called from uv_init and hence from the first call to most any nontrivial libuv function.
I am seeing this behavior from multiple CMake versions, as long as they support -E server (tested 3.7.2, 3.9.0-rc2)