summaryrefslogtreecommitdiffstats
path: root/Source/cmSeparateArgumentsCommand.cxx
diff options
context:
space:
mode:
authorGabor Bencze <b.gabor98@gmail.com>2019-08-04 17:05:36 (GMT)
committerBrad King <brad.king@kitware.com>2019-08-20 18:42:20 (GMT)
commit2a9299782ece0e2c5f990fcab2162d141aedb833 (patch)
tree59efb7f814308fb9bd2c7c27db0ef74a628e0e31 /Source/cmSeparateArgumentsCommand.cxx
parentd780822da61afb5fd3014f7e15c68eb2eb0754c3 (diff)
downloadCMake-2a9299782ece0e2c5f990fcab2162d141aedb833.zip
CMake-2a9299782ece0e2c5f990fcab2162d141aedb833.tar.gz
CMake-2a9299782ece0e2c5f990fcab2162d141aedb833.tar.bz2
cmCommand refactor: cmSeparateArgumentsCommand
Diffstat (limited to 'Source/cmSeparateArgumentsCommand.cxx')
-rw-r--r--Source/cmSeparateArgumentsCommand.cxx17
1 files changed, 8 insertions, 9 deletions
diff --git a/Source/cmSeparateArgumentsCommand.cxx b/Source/cmSeparateArgumentsCommand.cxx
index ab4a0c7..27f45a8 100644
--- a/Source/cmSeparateArgumentsCommand.cxx
+++ b/Source/cmSeparateArgumentsCommand.cxx
@@ -5,17 +5,16 @@
#include <algorithm>
#include <sstream>
+#include "cmExecutionStatus.h"
#include "cmMakefile.h"
#include "cmSystemTools.h"
-class cmExecutionStatus;
-
// cmSeparateArgumentsCommand
-bool cmSeparateArgumentsCommand::InitialPass(
- std::vector<std::string> const& args, cmExecutionStatus&)
+bool cmSeparateArgumentsCommand(std::vector<std::string> const& args,
+ cmExecutionStatus& status)
{
if (args.empty()) {
- this->SetError("must be given at least one argument.");
+ status.SetError("must be given at least one argument.");
return false;
}
@@ -59,17 +58,17 @@ bool cmSeparateArgumentsCommand::InitialPass(
} else {
std::ostringstream e;
e << "given unknown argument " << arg;
- this->SetError(e.str());
+ status.SetError(e.str());
return false;
}
}
if (mode == ModeOld) {
// Original space-replacement version of command.
- if (const char* def = this->Makefile->GetDefinition(var)) {
+ if (const char* def = status.GetMakefile().GetDefinition(var)) {
std::string value = def;
std::replace(value.begin(), value.end(), ' ', ';');
- this->Makefile->AddDefinition(var, value);
+ status.GetMakefile().AddDefinition(var, value);
}
} else {
// Parse the command line.
@@ -97,7 +96,7 @@ bool cmSeparateArgumentsCommand::InitialPass(
value += si;
}
}
- this->Makefile->AddDefinition(var, value);
+ status.GetMakefile().AddDefinition(var, value);
}
return true;