summaryrefslogtreecommitdiffstats
path: root/Source/cmCommand.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmCommand.h')
-rw-r--r--Source/cmCommand.h71
1 files changed, 30 insertions, 41 deletions
diff --git a/Source/cmCommand.h b/Source/cmCommand.h
index d5e394d..0157293 100644
--- a/Source/cmCommand.h
+++ b/Source/cmCommand.h
@@ -37,7 +37,10 @@ public:
* Construct the command. By default it is enabled with no makefile.
*/
cmCommand()
- {this->Makefile = 0; this->Enabled = true;}
+ {
+ this->Makefile = 0;
+ this->Enabled = true;
+ }
/**
* Need virtual destructor to destroy real command type.
@@ -47,8 +50,7 @@ public:
/**
* Specify the makefile.
*/
- void SetMakefile(cmMakefile*m)
- {this->Makefile = m; }
+ void SetMakefile(cmMakefile* m) { this->Makefile = m; }
cmMakefile* GetMakefile() { return this->Makefile; }
/**
@@ -57,24 +59,23 @@ public:
* arguments and then invokes the InitialPass.
*/
virtual bool InvokeInitialPass(const std::vector<cmListFileArgument>& args,
- cmExecutionStatus &status)
- {
+ cmExecutionStatus& status)
+ {
std::vector<std::string> expandedArguments;
- if(!this->Makefile->ExpandArguments(args, 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);
}
+ return this->InitialPass(expandedArguments, status);
+ }
/**
* This is called when the command is first encountered in
* the CMakeLists.txt file.
*/
virtual bool InitialPass(std::vector<std::string> const& args,
- cmExecutionStatus &) = 0;
+ cmExecutionStatus&) = 0;
/**
* This is called at the end after all the information
@@ -97,10 +98,7 @@ public:
/**
* This determines if the command is invoked when in script mode.
*/
- virtual bool IsScriptable() const
- {
- return false;
- }
+ virtual bool IsScriptable() const { return false; }
/**
* This is used to avoid including this command
@@ -108,10 +106,7 @@ public:
* cmMacroHelperCommand and cmFunctionHelperCommand
* which cannot provide appropriate documentation.
*/
- virtual bool ShouldAppearInDocumentation() const
- {
- return true;
- }
+ virtual bool ShouldAppearInDocumentation() const { return true; }
/**
* The name of the command as specified in CMakeList.txt.
@@ -121,58 +116,52 @@ public:
/**
* Enable the command.
*/
- void EnabledOn()
- {this->Enabled = true;}
+ void EnabledOn() { this->Enabled = true; }
/**
* Disable the command.
*/
- void EnabledOff()
- {this->Enabled = false;}
+ void EnabledOff() { this->Enabled = false; }
/**
* Query whether the command is enabled.
*/
- bool GetEnabled() const
- {return this->Enabled;}
+ bool GetEnabled() const { return this->Enabled; }
/**
* Disable or enable the command.
*/
- void SetEnabled(bool enabled)
- {this->Enabled = enabled;}
+ void SetEnabled(bool enabled) { this->Enabled = enabled; }
/**
* Return the last error string.
*/
const char* GetError()
- {
- if(this->Error.empty())
- {
- this->Error = this->GetName();
- this->Error += " unknown error.";
- }
- return this->Error.c_str();
+ {
+ if (this->Error.empty()) {
+ this->Error = this->GetName();
+ this->Error += " unknown error.";
}
+ return this->Error.c_str();
+ }
/**
* Set the error message
*/
void SetError(const std::string& e)
- {
+ {
this->Error = this->GetName();
this->Error += " ";
this->Error += e;
- }
+ }
/** Check if the command is disallowed by a policy. */
bool Disallowed(cmPolicies::PolicyID pol, const char* e)
- {
- switch(this->Makefile->GetPolicyStatus(pol))
- {
+ {
+ switch (this->Makefile->GetPolicyStatus(pol)) {
case cmPolicies::WARN:
this->Makefile->IssueMessage(cmake::AUTHOR_WARNING,
- cmPolicies::GetPolicyWarning(pol));
+ cmPolicies::GetPolicyWarning(pol));
case cmPolicies::OLD:
return false;
case cmPolicies::REQUIRED_IF_USED:
@@ -180,9 +169,9 @@ public:
case cmPolicies::NEW:
this->Makefile->IssueMessage(cmake::FATAL_ERROR, e);
break;
- }
- return true;
}
+ return true;
+ }
protected:
cmMakefile* Makefile;