diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index ba41d98c4..7dcb6c32e 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -214,6 +214,8 @@ SET(SRCS
cmMakefileExecutableTargetGenerator.cxx
cmMakefileLibraryTargetGenerator.cxx
cmMakefileUtilityTargetGenerator.cxx
+ cmNewLineStyle.h
+ cmNewLineStyle.cxx
cmOrderDirectories.cxx
cmOrderDirectories.h
cmPolicies.h
diff --git a/Source/cmConfigureFileCommand.cxx b/Source/cmConfigureFileCommand.cxx
index c1327fbf1..ea98326e2 100644
--- a/Source/cmConfigureFileCommand.cxx
+++ b/Source/cmConfigureFileCommand.cxx
@@ -65,6 +65,12 @@ bool cmConfigureFileCommand
cmSystemTools::SetFatalErrorOccured();
return false;
}
+ std::string errorMessage;
+ if (!this->NewLineStyle.ReadFromArguments(args, errorMessage))
+ {
+ this->SetError(errorMessage.c_str());
+ return false;
+ }
this->CopyOnly = false;
this->EscapeQuotes = false;
@@ -78,6 +84,12 @@ bool cmConfigureFileCommand
if(args[i] == "COPYONLY")
{
this->CopyOnly = true;
+ if (this->NewLineStyle.IsValid())
+ {
+ this->SetError("COPYONLY could not be used in combination "
+ "with NEWLINE_STYLE");
+ return false;
+ }
}
else if(args[i] == "ESCAPE_QUOTES")
{
@@ -122,7 +134,8 @@ int cmConfigureFileCommand::ConfigureFile()
this->OutputFile.c_str(),
this->CopyOnly,
this->AtOnly,
- this->EscapeQuotes);
+ this->EscapeQuotes,
+ this->NewLineStyle);
}
diff --git a/Source/cmConfigureFileCommand.h b/Source/cmConfigureFileCommand.h
index 844a23cda..be33569fe 100644
--- a/Source/cmConfigureFileCommand.h
+++ b/Source/cmConfigureFileCommand.h
@@ -56,7 +56,8 @@ public:
{
return
" configure_file(