diff options
Diffstat (limited to 'Source/cmWriteFileCommand.cxx')
-rw-r--r-- | Source/cmWriteFileCommand.cxx | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Source/cmWriteFileCommand.cxx b/Source/cmWriteFileCommand.cxx index 7620b34..93ecd2d 100644 --- a/Source/cmWriteFileCommand.cxx +++ b/Source/cmWriteFileCommand.cxx @@ -30,14 +30,22 @@ bool cmWriteFileCommand::InitialPass(std::vector<std::string> const& argsIn) std::vector<std::string>::const_iterator i = args.begin(); std::string fileName = *i; + bool overwrite = true; i++; for(;i != args.end(); ++i) { - message += *i; + if ( *i == "APPEND" ) + { + overwrite = false; + } + else + { + message += *i; + } } - std::ofstream file(fileName.c_str(), std::ios::app); + std::ofstream file(fileName.c_str(), overwrite?std::ios::out : std::ios::app); if ( !file ) { cmSystemTools::Error("Internal CMake error when trying to open file: ", |