summaryrefslogtreecommitdiffstats
path: root/Source/cmCommand.cxx
diff options
context:
space:
mode:
authorDaniel Pfeifer <daniel@pfeifer-mail.de>2016-10-19 22:29:18 (GMT)
committerDaniel Pfeifer <daniel@pfeifer-mail.de>2016-10-21 16:14:51 (GMT)
commit6c9b3b5c03b41842d3d79c1bd80691be7e5c6f89 (patch)
tree2a3d630a70a3e5d6eeef5dc99847d51bcedd8589 /Source/cmCommand.cxx
parent8483dab8e16b9734ac7d2b90b95d474ce8502e40 (diff)
downloadCMake-6c9b3b5c03b41842d3d79c1bd80691be7e5c6f89.zip
CMake-6c9b3b5c03b41842d3d79c1bd80691be7e5c6f89.tar.gz
CMake-6c9b3b5c03b41842d3d79c1bd80691be7e5c6f89.tar.bz2
cmCommand: implement functions in cxx file
Diffstat (limited to 'Source/cmCommand.cxx')
-rw-r--r--Source/cmCommand.cxx48
1 files changed, 48 insertions, 0 deletions
diff --git a/Source/cmCommand.cxx b/Source/cmCommand.cxx
new file mode 100644
index 0000000..3c839de
--- /dev/null
+++ b/Source/cmCommand.cxx
@@ -0,0 +1,48 @@
+/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ file Copyright.txt or https://cmake.org/licensing for details. */
+#include "cmCommand.h"
+
+bool cmCommand::InvokeInitialPass(const std::vector<cmListFileArgument>& args,
+ cmExecutionStatus& status)
+{
+ std::vector<std::string> expandedArguments;
+ if (!this->Makefile->ExpandArguments(args, expandedArguments)) {
+ // There was an error expanding arguments. It was already
+ // reported, so we can skip this command without error.
+ return true;
+ }
+ return this->InitialPass(expandedArguments, status);
+}
+
+const char* cmCommand::GetError()
+{
+ if (this->Error.empty()) {
+ this->Error = this->GetName();
+ this->Error += " unknown error.";
+ }
+ return this->Error.c_str();
+}
+
+void cmCommand::SetError(const std::string& e)
+{
+ this->Error = this->GetName();
+ this->Error += " ";
+ this->Error += e;
+}
+
+bool cmCommand::Disallowed(cmPolicies::PolicyID pol, const char* e)
+{
+ switch (this->Makefile->GetPolicyStatus(pol)) {
+ case cmPolicies::WARN:
+ this->Makefile->IssueMessage(cmake::AUTHOR_WARNING,
+ cmPolicies::GetPolicyWarning(pol));
+ case cmPolicies::OLD:
+ return false;
+ case cmPolicies::REQUIRED_IF_USED:
+ case cmPolicies::REQUIRED_ALWAYS:
+ case cmPolicies::NEW:
+ this->Makefile->IssueMessage(cmake::FATAL_ERROR, e);
+ break;
+ }
+ return true;
+}