[Cmake-commits] CMake branch, next, updated. v3.6.0-rc3-539-g56b88e2

Gregor Jasny gjasny at googlemail.com
Sun Jun 26 16:18:45 EDT 2016


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  56b88e20cd8dfdb1cd2abb8ff300b4c48ec06714 (commit)
       via  2ca76a6651dd16586334067f6a41524a4015adc9 (commit)
       via  c68cf9e4d111fa7c92973acec92d71ce6d187ff9 (commit)
      from  76e61c487c40540d7a7bd58a4aaf375d4241b09a (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=56b88e20cd8dfdb1cd2abb8ff300b4c48ec06714
commit 56b88e20cd8dfdb1cd2abb8ff300b4c48ec06714
Merge: 76e61c4 2ca76a6
Author:     Gregor Jasny <gjasny at googlemail.com>
AuthorDate: Sun Jun 26 16:18:43 2016 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Sun Jun 26 16:18:43 2016 -0400

    Merge topic 'unknown-aliased-target' into next
    
    2ca76a66 Validate target name in ALIASED_TARGET property getter
    c68cf9e4 CMake Nightly Date Stamp


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2ca76a6651dd16586334067f6a41524a4015adc9
commit 2ca76a6651dd16586334067f6a41524a4015adc9
Author:     Gregor Jasny <gjasny at googlemail.com>
AuthorDate: Sun Jun 26 22:00:00 2016 +0200
Commit:     Gregor Jasny <gjasny at googlemail.com>
CommitDate: Sun Jun 26 22:00:00 2016 +0200

    Validate target name in ALIASED_TARGET property getter

diff --git a/Source/cmGetPropertyCommand.cxx b/Source/cmGetPropertyCommand.cxx
index 06f7504..67b0e9d 100644
--- a/Source/cmGetPropertyCommand.cxx
+++ b/Source/cmGetPropertyCommand.cxx
@@ -248,15 +248,14 @@ bool cmGetPropertyCommand::HandleTargetMode()
     return false;
   }
 
-  if (this->PropertyName == "ALIASED_TARGET") {
-    if (this->Makefile->IsAlias(this->Name)) {
-      if (cmTarget* target = this->Makefile->FindTargetToUse(this->Name)) {
+  if (cmTarget* target = this->Makefile->FindTargetToUse(this->Name)) {
+    if (this->PropertyName == "ALIASED_TARGET") {
+      if (this->Makefile->IsAlias(this->Name)) {
         return this->StoreResult(target->GetName().c_str());
+      } else {
+        return this->StoreResult((this->Variable + "-NOTFOUND").c_str());
       }
     }
-    return this->StoreResult((this->Variable + "-NOTFOUND").c_str());
-  }
-  if (cmTarget* target = this->Makefile->FindTargetToUse(this->Name)) {
     return this->StoreResult(
       target->GetProperty(this->PropertyName, this->Makefile));
   } else {
diff --git a/Source/cmGetTargetPropertyCommand.cxx b/Source/cmGetTargetPropertyCommand.cxx
index dded9f7..073cf32 100644
--- a/Source/cmGetTargetPropertyCommand.cxx
+++ b/Source/cmGetTargetPropertyCommand.cxx
@@ -24,22 +24,18 @@ bool cmGetTargetPropertyCommand::InitialPass(
   std::string prop;
   bool prop_exists = false;
 
-  if (args[2] == "ALIASED_TARGET") {
-    if (this->Makefile->IsAlias(targetName)) {
-      if (cmTarget* target = this->Makefile->FindTargetToUse(targetName)) {
-        prop = target->GetName();
+  if (cmTarget* tgt = this->Makefile->FindTargetToUse(targetName)) {
+    if (args[2] == "ALIASED_TARGET") {
+      if (this->Makefile->IsAlias(targetName)) {
+        prop = tgt->GetName();
+        prop_exists = true;
+      }
+    } else if (!args[2].empty()) {
+      const char* prop_cstr = tgt->GetProperty(args[2], this->Makefile);
+      if (prop_cstr) {
+        prop = prop_cstr;
         prop_exists = true;
       }
-    }
-  } else if (cmTarget* tgt = this->Makefile->FindTargetToUse(targetName)) {
-    cmTarget& target = *tgt;
-    const char* prop_cstr = 0;
-    if (!args[2].empty()) {
-      prop_cstr = target.GetProperty(args[2], this->Makefile);
-    }
-    if (prop_cstr) {
-      prop = prop_cstr;
-      prop_exists = true;
     }
   } else {
     bool issueMessage = false;

-----------------------------------------------------------------------

Summary of changes:
 Source/CMakeVersion.cmake             |    2 +-
 Source/cmGetPropertyCommand.cxx       |   11 +++++------
 Source/cmGetTargetPropertyCommand.cxx |   24 ++++++++++--------------
 3 files changed, 16 insertions(+), 21 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list