diff options
author | Stephen Kelly <steveire@gmail.com> | 2014-04-25 18:11:05 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2014-04-30 13:18:13 (GMT) |
commit | 42e1cd137c0eff0297adaea5b34abca0da254eba (patch) | |
tree | cb0911144205f1bd269c157ed99c4bc2b630f0f2 /Source/cmGeneratorExpressionEvaluationFile.cxx | |
parent | 3c8226e590f252977e0ab79d7fe85b2fb9e7ef78 (diff) | |
download | CMake-42e1cd137c0eff0297adaea5b34abca0da254eba.zip CMake-42e1cd137c0eff0297adaea5b34abca0da254eba.tar.gz CMake-42e1cd137c0eff0297adaea5b34abca0da254eba.tar.bz2 |
file(GENERATE): Only write the file if content is different.
No policy is used to control this behavior for now.
Diffstat (limited to 'Source/cmGeneratorExpressionEvaluationFile.cxx')
-rw-r--r-- | Source/cmGeneratorExpressionEvaluationFile.cxx | 15 |
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(); } //---------------------------------------------------------------------------- |