summaryrefslogtreecommitdiffstats
path: root/Source/cmAddSubDirectoryCommand.cxx
diff options
context:
space:
mode:
authorAsit Dhal <dhal.asitk@gmail.com>2019-09-15 17:11:02 (GMT)
committerBrad King <brad.king@kitware.com>2019-09-18 18:18:46 (GMT)
commit9dba84cfa5e85e51ee6d6799f03a26656063ef8b (patch)
tree22fb29536def399e2ab763ac202a52467d45d7e2 /Source/cmAddSubDirectoryCommand.cxx
parent1423507a71199fd76b457ad9b215a6caca70ee58 (diff)
downloadCMake-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/cmAddSubDirectoryCommand.cxx')
-rw-r--r--Source/cmAddSubDirectoryCommand.cxx15
1 files changed, 7 insertions, 8 deletions
diff --git a/Source/cmAddSubDirectoryCommand.cxx b/Source/cmAddSubDirectoryCommand.cxx
index c0be308..6a1a514 100644
--- a/Source/cmAddSubDirectoryCommand.cxx
+++ b/Source/cmAddSubDirectoryCommand.cxx
@@ -3,7 +3,6 @@
#include "cmAddSubDirectoryCommand.h"
#include <cstring>
-#include <sstream>
#include "cmExecutionStatus.h"
#include "cmMakefile.h"
@@ -64,13 +63,13 @@ bool cmAddSubDirectoryCommand(std::vector<std::string> const& args,
// error.
if (!cmSystemTools::IsSubDirectory(srcPath,
mf.GetCurrentSourceDirectory())) {
- std::ostringstream e;
- e << "not given a binary directory but the given source directory "
- << "\"" << srcPath << "\" is not a subdirectory of \""
- << mf.GetCurrentSourceDirectory() << "\". "
- << "When specifying an out-of-tree source a binary directory "
- << "must be explicitly specified.";
- status.SetError(e.str());
+ status.SetError(
+ cmStrCat("not given a binary directory but the given source ",
+ "directory \"", srcPath, "\" is not a subdirectory of \"",
+ mf.GetCurrentSourceDirectory(),
+ "\". When specifying an "
+ "out-of-tree source a binary directory must be explicitly "
+ "specified."));
return false;
}