Merge topic 'file-configure-endl'

05f16ca7ee file(CONFIGURE): Use text mode for default OUTPUT content

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Asit Dhal <dhal.asitk@gmail.com>
Merge-request: !5762
This commit is contained in:
Brad King
2021-02-03 15:45:44 +00:00
committed by Kitware Robot
2 changed files with 8 additions and 2 deletions
+3 -1
View File
@@ -3122,12 +3122,14 @@ bool HandleConfigureCommand(std::vector<std::string> const& args,
}
std::string newLineCharacters = "\n";
bool open_with_binary_flag = false;
if (newLineStyle.IsValid()) {
newLineCharacters = newLineStyle.GetCharacters();
open_with_binary_flag = true;
}
cmGeneratedFileStream fout;
fout.Open(outputFile, false, true);
fout.Open(outputFile, false, open_with_binary_flag);
if (!fout) {
cmSystemTools::Error("Could not open file for write in copy operation " +
outputFile);
@@ -22,4 +22,8 @@ test_eol(CRLF "c" "630d0a")
test_eol(UNIX "d" "640a")
test_eol(LF "e" "650a")
test_eol("" "a\nb" "610a62")
if (WIN32)
test_eol("" "a\nb" "610d0a62")
elseif(UNIX)
test_eol("" "a\nb" "610a62")
endif()