diff options
author | Asit Dhal <dhal.asitk@gmail.com> | 2019-09-15 17:11:02 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-09-18 18:18:46 (GMT) |
commit | 9dba84cfa5e85e51ee6d6799f03a26656063ef8b (patch) | |
tree | 22fb29536def399e2ab763ac202a52467d45d7e2 /Source/cmAddCustomCommandCommand.cxx | |
parent | 1423507a71199fd76b457ad9b215a6caca70ee58 (diff) | |
download | CMake-9dba84cfa5e85e51ee6d6799f03a26656063ef8b.zip CMake-9dba84cfa5e85e51ee6d6799f03a26656063ef8b.tar.gz CMake-9dba84cfa5e85e51ee6d6799f03a26656063ef8b.tar.bz2 |
Refactor: Use cmStrCat to construct error strings
Replace string construction using std::stringstream with cmStrCat and
cmWrap.
Diffstat (limited to 'Source/cmAddCustomCommandCommand.cxx')
-rw-r--r-- | Source/cmAddCustomCommandCommand.cxx | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/Source/cmAddCustomCommandCommand.cxx b/Source/cmAddCustomCommandCommand.cxx index c91198c..35db6a4 100644 --- a/Source/cmAddCustomCommandCommand.cxx +++ b/Source/cmAddCustomCommandCommand.cxx @@ -321,10 +321,9 @@ bool cmAddCustomCommandCommand(std::vector<std::string> const& args, } // No command for this output exists. - std::ostringstream e; - e << "given APPEND option with output\n\"" << output[0] - << "\"\nwhich is not already a custom command output."; - status.SetError(e.str()); + status.SetError( + cmStrCat("given APPEND option with output\n\"", output[0], + "\"\nwhich is not already a custom command output.")); return false; } @@ -407,10 +406,8 @@ bool cmAddCustomCommandCommandCheckOutputs( // Make sure the output file name has no invalid characters. std::string::size_type pos = o.find_first_of("#<>"); if (pos != std::string::npos) { - std::ostringstream msg; - msg << "called with OUTPUT containing a \"" << o[pos] - << "\". This character is not allowed."; - status.SetError(msg.str()); + status.SetError(cmStrCat("called with OUTPUT containing a \"", o[pos], + "\". This character is not allowed.")); return false; } } |