diff options
author | Brad King <brad.king@kitware.com> | 2019-09-13 13:52:23 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-09-13 13:52:34 (GMT) |
commit | bacb50afa9ed7806a8900ab7524f2f4a4cd7d669 (patch) | |
tree | 75fb21b14c4ed42cdca1d9adfc3dad6e38f88927 /Source/cmGetTargetPropertyCommand.cxx | |
parent | 729c928c7b59919a9d379891973bda22665c75da (diff) | |
parent | a81e9a0ced25490d1384316834dff36a55d4e864 (diff) | |
download | CMake-bacb50afa9ed7806a8900ab7524f2f4a4cd7d669.zip CMake-bacb50afa9ed7806a8900ab7524f2f4a4cd7d669.tar.gz CMake-bacb50afa9ed7806a8900ab7524f2f4a4cd7d669.tar.bz2 |
Merge topic 'free-free-set-them-free'
a81e9a0ced cmSubdirCommand: Port away from cmCommand
573cd4e4b4 cmSetTestsPropertiesCommand: Port away from cmCommand
95f23ea5d5 cmSetSourceFilesPropertiesCommand: Port away from cmCommand
706400d417 cmRemoveDefinitionsCommand: Port away from cmCommand
7f86990262 cmQTWrapUICommand: Port away from cmCommand
56bfb8de5d cmQTWrapCPPCommand: Port away from cmCommand
83b3f76a3b cmLinkLibrariesCommand: Port away from cmCommand
b85407ae76 cmInstallTargetsCommand: Port away from cmCommand
...
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3807
Diffstat (limited to 'Source/cmGetTargetPropertyCommand.cxx')
-rw-r--r-- | Source/cmGetTargetPropertyCommand.cxx | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/Source/cmGetTargetPropertyCommand.cxx b/Source/cmGetTargetPropertyCommand.cxx index 07aaf02..7f5df9c 100644 --- a/Source/cmGetTargetPropertyCommand.cxx +++ b/Source/cmGetTargetPropertyCommand.cxx @@ -4,6 +4,7 @@ #include <sstream> +#include "cmExecutionStatus.h" #include "cmListFileCache.h" #include "cmMakefile.h" #include "cmMessageType.h" @@ -11,32 +12,31 @@ #include "cmTarget.h" #include "cmTargetPropertyComputer.h" -class cmExecutionStatus; class cmMessenger; -// cmSetTargetPropertyCommand -bool cmGetTargetPropertyCommand::InitialPass( - std::vector<std::string> const& args, cmExecutionStatus&) +bool cmGetTargetPropertyCommand(std::vector<std::string> const& args, + cmExecutionStatus& status) { if (args.size() != 3) { - this->SetError("called with incorrect number of arguments"); + status.SetError("called with incorrect number of arguments"); return false; } std::string const& var = args[0]; std::string const& targetName = args[1]; std::string prop; bool prop_exists = false; + cmMakefile& mf = status.GetMakefile(); - if (cmTarget* tgt = this->Makefile->FindTargetToUse(targetName)) { + if (cmTarget* tgt = mf.FindTargetToUse(targetName)) { if (args[2] == "ALIASED_TARGET") { - if (this->Makefile->IsAlias(targetName)) { + if (mf.IsAlias(targetName)) { prop = tgt->GetName(); prop_exists = true; } } else if (!args[2].empty()) { const char* prop_cstr = nullptr; - cmListFileBacktrace bt = this->Makefile->GetBacktrace(); - cmMessenger* messenger = this->Makefile->GetMessenger(); + cmListFileBacktrace bt = mf.GetBacktrace(); + cmMessenger* messenger = mf.GetMessenger(); if (cmTargetPropertyComputer::PassesWhitelist(tgt->GetType(), args[2], messenger, bt)) { prop_cstr = tgt->GetComputedProperty(args[2], messenger, bt); @@ -53,7 +53,7 @@ bool cmGetTargetPropertyCommand::InitialPass( bool issueMessage = false; std::ostringstream e; MessageType messageType = MessageType::AUTHOR_WARNING; - switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP0045)) { + switch (mf.GetPolicyStatus(cmPolicies::CMP0045)) { case cmPolicies::WARN: issueMessage = true; e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0045) << "\n"; @@ -68,16 +68,16 @@ bool cmGetTargetPropertyCommand::InitialPass( if (issueMessage) { e << "get_target_property() called with non-existent target \"" << targetName << "\"."; - this->Makefile->IssueMessage(messageType, e.str()); + mf.IssueMessage(messageType, e.str()); if (messageType == MessageType::FATAL_ERROR) { return false; } } } if (prop_exists) { - this->Makefile->AddDefinition(var, prop); + mf.AddDefinition(var, prop); return true; } - this->Makefile->AddDefinition(var, var + "-NOTFOUND"); + mf.AddDefinition(var, var + "-NOTFOUND"); return true; } |