summaryrefslogtreecommitdiffstats
path: root/Source/cmGetTargetPropertyCommand.cxx
diff options
context:
space:
mode:
authorKitware Robot <kwrobot@kitware.com>2016-05-16 14:34:04 (GMT)
committerBrad King <brad.king@kitware.com>2016-05-16 20:05:19 (GMT)
commitd9fd2f5402eeaa345691313658e02b51038f570b (patch)
treedca71b9a7e267f4c6300da3eb770415381726785 /Source/cmGetTargetPropertyCommand.cxx
parent82df6deaafb36cbbfd450202bb20b320f637751a (diff)
downloadCMake-d9fd2f5402eeaa345691313658e02b51038f570b.zip
CMake-d9fd2f5402eeaa345691313658e02b51038f570b.tar.gz
CMake-d9fd2f5402eeaa345691313658e02b51038f570b.tar.bz2
Revise C++ coding style using clang-format
Run the `Utilities/Scripts/clang-format.bash` script to update all our C++ code to a new style defined by `.clang-format`. Use `clang-format` version 3.8. * If you reached this commit for a line in `git blame`, re-run the blame operation starting at the parent of this commit to see older history for the content. * See the parent commit for instructions to rebase a change across this style transition commit.
Diffstat (limited to 'Source/cmGetTargetPropertyCommand.cxx')
-rw-r--r--Source/cmGetTargetPropertyCommand.cxx58
1 files changed, 21 insertions, 37 deletions
diff --git a/Source/cmGetTargetPropertyCommand.cxx b/Source/cmGetTargetPropertyCommand.cxx
index ca40bd0..dded9f7 100644
--- a/Source/cmGetTargetPropertyCommand.cxx
+++ b/Source/cmGetTargetPropertyCommand.cxx
@@ -12,52 +12,40 @@
#include "cmGetTargetPropertyCommand.h"
// cmSetTargetPropertyCommand
-bool cmGetTargetPropertyCommand
-::InitialPass(std::vector<std::string> const& args, cmExecutionStatus &)
+bool cmGetTargetPropertyCommand::InitialPass(
+ std::vector<std::string> const& args, cmExecutionStatus&)
{
- if(args.size() != 3 )
- {
+ if (args.size() != 3) {
this->SetError("called with incorrect number of arguments");
return false;
- }
+ }
std::string var = args[0];
const std::string& targetName = args[1];
std::string prop;
bool prop_exists = false;
- if(args[2] == "ALIASED_TARGET")
- {
- if(this->Makefile->IsAlias(targetName))
- {
- if(cmTarget* target =
- this->Makefile->FindTargetToUse(targetName))
- {
+ if (args[2] == "ALIASED_TARGET") {
+ if (this->Makefile->IsAlias(targetName)) {
+ if (cmTarget* target = this->Makefile->FindTargetToUse(targetName)) {
prop = target->GetName();
prop_exists = true;
- }
}
}
- else if(cmTarget* tgt = this->Makefile->FindTargetToUse(targetName))
- {
+ } else if (cmTarget* tgt = this->Makefile->FindTargetToUse(targetName)) {
cmTarget& target = *tgt;
const char* prop_cstr = 0;
- if (!args[2].empty())
- {
+ if (!args[2].empty()) {
prop_cstr = target.GetProperty(args[2], this->Makefile);
- }
- if(prop_cstr)
- {
+ }
+ if (prop_cstr) {
prop = prop_cstr;
prop_exists = true;
- }
}
- else
- {
+ } else {
bool issueMessage = false;
std::ostringstream e;
cmake::MessageType messageType = cmake::AUTHOR_WARNING;
- switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0045))
- {
+ switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP0045)) {
case cmPolicies::WARN:
issueMessage = true;
e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0045) << "\n";
@@ -68,24 +56,20 @@ bool cmGetTargetPropertyCommand
case cmPolicies::NEW:
issueMessage = true;
messageType = cmake::FATAL_ERROR;
- }
- if (issueMessage)
- {
+ }
+ if (issueMessage) {
e << "get_target_property() called with non-existent target \""
- << targetName << "\".";
+ << targetName << "\".";
this->Makefile->IssueMessage(messageType, e.str());
- if (messageType == cmake::FATAL_ERROR)
- {
+ if (messageType == cmake::FATAL_ERROR) {
return false;
- }
}
}
- if (prop_exists)
- {
+ }
+ if (prop_exists) {
this->Makefile->AddDefinition(var, prop.c_str());
return true;
- }
- this->Makefile->AddDefinition(var, (var+"-NOTFOUND").c_str());
+ }
+ this->Makefile->AddDefinition(var, (var + "-NOTFOUND").c_str());
return true;
}
-