diff -Nru cmake-3.5.1/debian/changelog cmake-3.5.1/debian/changelog --- cmake-3.5.1/debian/changelog 2016-03-30 07:40:44.000000000 +0200 +++ cmake-3.5.1/debian/changelog 2016-04-01 16:05:48.000000000 +0200 @@ -1,3 +1,12 @@ +cmake (3.5.1-1ubuntu2) xenial; urgency=medium + + [ Matteo Settenvini ] + * debian/patches/lp-1564741.patch: LP: #1564741 + - Fix lookup of an ALIAS target outside aliased target's + directory + + -- Gianfranco Costamagna Fri, 01 Apr 2016 16:04:56 +0200 + cmake (3.5.1-1ubuntu1) xenial; urgency=medium * Merge from Debian unstable (LP: #1563580). Remaining changes: diff -Nru cmake-3.5.1/debian/patches/lp-1564741.patch cmake-3.5.1/debian/patches/lp-1564741.patch --- cmake-3.5.1/debian/patches/lp-1564741.patch 1970-01-01 01:00:00.000000000 +0100 +++ cmake-3.5.1/debian/patches/lp-1564741.patch 2016-04-01 16:06:01.000000000 +0200 @@ -0,0 +1,97 @@ +From 275a7c26d2d84893d1cde946b12dfba5839a35ed Mon Sep 17 00:00:00 2001 +From: Brad King +Date: Fri, 1 Apr 2016 09:13:16 -0400 +Subject: [PATCH] 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 +--- + Source/cmMakefile.cxx | 16 ++-------------- + Source/cmMakefile.h | 3 +-- + Tests/AliasTarget/subdir/CMakeLists.txt | 4 ++++ + 3 files changed, 7 insertions(+), 16 deletions(-) + +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 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::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 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) +-- +1.7.10.4 + diff -Nru cmake-3.5.1/debian/patches/series cmake-3.5.1/debian/patches/series --- cmake-3.5.1/debian/patches/series 2016-03-30 07:40:29.000000000 +0200 +++ cmake-3.5.1/debian/patches/series 2016-04-01 16:04:56.000000000 +0200 @@ -3,3 +3,4 @@ fix-ftbfs-on-kfreebsd.patch ubuntu_boost-multiarch.patch ubuntu_cmake-crosscompile.patch +lp-1564741.patch