diff options
author | Brad King <brad.king@kitware.com> | 2019-08-22 14:23:35 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-08-22 14:25:09 (GMT) |
commit | 130dbe4a5d49baa4404a399860bd3a6182783ece (patch) | |
tree | 2eda1810d047df4dd02f1485ef295cebe04baeec /Source/cmGetCMakePropertyCommand.cxx | |
parent | 337be1507d0850c1d83de0f9ad87a780c9cb61af (diff) | |
parent | 6ab28b9413ade87cf9fbaad439f8cb4c27ecc97f (diff) | |
download | CMake-130dbe4a5d49baa4404a399860bd3a6182783ece.zip CMake-130dbe4a5d49baa4404a399860bd3a6182783ece.tar.gz CMake-130dbe4a5d49baa4404a399860bd3a6182783ece.tar.bz2 |
Merge topic 'cmCommand_refactor'
6ab28b9413 cmCommand refactor: cmStringCommand
36f32d3604 cmCommand refactor: cmSetPropertyCommand
7c83c19205 cmCommand refactor: cmSetDirectoryPropertiesCommand
9413952c42 cmCommand refactor: cmCMakePolicyCommand
07ea93de54 cmCommand refactor: cmWriteFileCommand
ca3b9186bb cmCommand refactor: cmVariableWatchCommand
b1acc711f4 cmCommand refactor: cmRemoveCommand
413a960391 cmCommand refactor: cmCMakeHostSystemInformationCommand
...
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3673
Diffstat (limited to 'Source/cmGetCMakePropertyCommand.cxx')
-rw-r--r-- | Source/cmGetCMakePropertyCommand.cxx | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/Source/cmGetCMakePropertyCommand.cxx b/Source/cmGetCMakePropertyCommand.cxx index 38fee28..ff4e312 100644 --- a/Source/cmGetCMakePropertyCommand.cxx +++ b/Source/cmGetCMakePropertyCommand.cxx @@ -4,19 +4,18 @@ #include <set> +#include "cmExecutionStatus.h" #include "cmGlobalGenerator.h" #include "cmMakefile.h" #include "cmState.h" #include "cmStringAlgorithms.h" -class cmExecutionStatus; - // cmGetCMakePropertyCommand -bool cmGetCMakePropertyCommand::InitialPass( - std::vector<std::string> const& args, cmExecutionStatus&) +bool cmGetCMakePropertyCommand(std::vector<std::string> const& args, + cmExecutionStatus& status) { if (args.size() < 2) { - this->SetError("called with incorrect number of arguments"); + status.SetError("called with incorrect number of arguments"); return false; } @@ -24,29 +23,29 @@ bool cmGetCMakePropertyCommand::InitialPass( std::string output = "NOTFOUND"; if (args[1] == "VARIABLES") { - if (const char* varsProp = this->Makefile->GetProperty("VARIABLES")) { + if (const char* varsProp = status.GetMakefile().GetProperty("VARIABLES")) { output = varsProp; } } else if (args[1] == "MACROS") { output.clear(); - if (const char* macrosProp = this->Makefile->GetProperty("MACROS")) { + if (const char* macrosProp = status.GetMakefile().GetProperty("MACROS")) { output = macrosProp; } } else if (args[1] == "COMPONENTS") { const std::set<std::string>* components = - this->Makefile->GetGlobalGenerator()->GetInstallComponents(); + status.GetMakefile().GetGlobalGenerator()->GetInstallComponents(); output = cmJoin(*components, ";"); } else { const char* prop = nullptr; if (!args[1].empty()) { - prop = this->Makefile->GetState()->GetGlobalProperty(args[1]); + prop = status.GetMakefile().GetState()->GetGlobalProperty(args[1]); } if (prop) { output = prop; } } - this->Makefile->AddDefinition(variable, output); + status.GetMakefile().AddDefinition(variable, output); return true; } |