summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGeneratorExpressionEvaluationFile.cxx15
1 files changed, 3 insertions, 12 deletions
diff --git a/Source/cmGeneratorExpressionEvaluationFile.cxx b/Source/cmGeneratorExpressionEvaluationFile.cxx
index 95a946a..01d31d3 100644
--- a/Source/cmGeneratorExpressionEvaluationFile.cxx
+++ b/Source/cmGeneratorExpressionEvaluationFile.cxx
@@ -13,6 +13,7 @@
#include "cmGeneratorExpressionEvaluationFile.h"
#include "cmMakefile.h"
+#include "cmGeneratedFileStream.h"
#include <cmsys/FStream.hxx>
#include <assert.h>
@@ -79,19 +80,9 @@ void cmGeneratorExpressionEvaluationFile::Generate(const std::string& config,
this->Files.push_back(outputFileName);
outputFiles[outputFileName] = outputContent;
- cmsys::ofstream fout(outputFileName.c_str());
-
- if(!fout)
- {
- cmOStringStream e;
- e << "Evaluation file \"" << outputFileName << "\" cannot be written.";
- this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
- return;
- }
-
+ cmGeneratedFileStream fout(outputFileName.c_str());
+ fout.SetCopyIfDifferent(true);
fout << outputContent;
-
- fout.close();
}
//----------------------------------------------------------------------------