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  e7f0fcf2e12610731d1b0ac34db3c0007add1f62 (commit)
       via  275a7c26d2d84893d1cde946b12dfba5839a35ed (commit)
      from  e929420e7af7d60aab7306f1af3956b31c30737c (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=e7f0fcf2e12610731d1b0ac34db3c0007add1f62
commit e7f0fcf2e12610731d1b0ac34db3c0007add1f62
Merge: e929420 275a7c2
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Fri Apr 1 09:42:06 2016 -0400
Commit:     CMake Topic Stage <kwro...@kitware.com>
CommitDate: Fri Apr 1 09:42:06 2016 -0400

    Merge topic 'fix-target-alias-in-subdir' into next
    
    275a7c26 Fix lookup of an ALIAS target outside aliased target's directory 
(#16044)


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=275a7c26d2d84893d1cde946b12dfba5839a35ed
commit 275a7c26d2d84893d1cde946b12dfba5839a35ed
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Fri Apr 1 09:13:16 2016 -0400
Commit:     Brad King <brad.k...@kitware.com>
CommitDate: Fri Apr 1 09:21:51 2016 -0400

    Fix lookup of an ALIAS target outside aliased target's directory (#16044)
    
    Refactoring in commit v3.5.0-rc1~272^2~11 (cmTarget: Implement ALIAS in
    terms of name mapping, 2015-10-25) accidentally introduced logic that
    assumes ALIAS targets always reference targets in their own directory.
    Fix this and add a test case.
    
    The fix is simply that `cmMakefile::FindTarget` should not consider
    aliases.  The purpose of this method is just to look up targets local to
    a directory.  Since ALIAS and normal targets share a namespace we know a
    locally defined target will never collide with an ALIAS target anyway.
    The method has 3 call sites, and this change is safe for all of them:
    
    * `cmInstallCommand::HandleTargetsMode`: Rejects aliases before the call.
    * `cmFLTKWrapUICommand::FinalPass`: Should never have considered aliases.
    * `cmMakefile::FindTargetToUse`: Falls back to a global lookup anyway.
    
    Reported-by: Matteo Settenvini <mat...@member.fsf.org>

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 600c985..598f8c4 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -4058,25 +4058,13 @@ std::vector<std::string> cmMakefile::GetPropertyKeys() 
const
   return this->StateSnapshot.GetDirectory().GetPropertyKeys();
 }
 
-cmTarget* cmMakefile::FindTarget(const std::string& name,
-                                 bool excludeAliases) const
+cmTarget* cmMakefile::FindTarget(const std::string& name) const
 {
-  if (!excludeAliases)
-    {
-    std::map<std::string, std::string>::const_iterator i =
-        this->AliasTargets.find(name);
-    if (i != this->AliasTargets.end())
-      {
-      cmTargets::iterator ai = this->Targets.find(i->second);
-      return &ai->second;
-      }
-    }
   cmTargets::iterator i = this->Targets.find( name );
   if ( i != this->Targets.end() )
     {
     return &i->second;
     }
-
   return 0;
 }
 
@@ -4247,7 +4235,7 @@ cmTarget* cmMakefile::FindTargetToUse(const std::string& 
name,
     }
 
   // Look for a target built in this directory.
-  if(cmTarget* t = this->FindTarget(name, excludeAliases))
+  if(cmTarget* t = this->FindTarget(name))
     {
     return t;
     }
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 362ea75..a69c705 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -388,8 +388,7 @@ public:
     }
   std::vector<cmTarget*> GetImportedTargets() const;
 
-  cmTarget* FindTarget(const std::string& name,
-                       bool excludeAliases = false) const;
+  cmTarget* FindTarget(const std::string& name) const;
 
   /** Find a target to use in place of the given name.  The target
       returned may be imported or built within the project.  */
diff --git a/Tests/AliasTarget/subdir/CMakeLists.txt 
b/Tests/AliasTarget/subdir/CMakeLists.txt
index 8c84aea..bf9e768 100644
--- a/Tests/AliasTarget/subdir/CMakeLists.txt
+++ b/Tests/AliasTarget/subdir/CMakeLists.txt
@@ -1,3 +1,7 @@
 
 add_library(tgt STATIC empty.cpp)
 add_library(Sub::tgt ALIAS tgt)
+
+# foo comes from the top-level CMakeLists.txt
+add_library(Top::foo ALIAS foo)
+get_target_property(a_prop Top::foo INTERFACE_SYSTEM_INCLUDE_DIRECTORIES)

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

Summary of changes:
 Source/cmMakefile.cxx                   |   16 ++--------------
 Source/cmMakefile.h                     |    3 +--
 Tests/AliasTarget/subdir/CMakeLists.txt |    4 ++++
 3 files changed, 7 insertions(+), 16 deletions(-)


hooks/post-receive
-- 
CMake
_______________________________________________
Cmake-commits mailing list
Cmake-commits@cmake.org
http://public.kitware.com/mailman/listinfo/cmake-commits

Reply via email to