From 0621362668af7b5ec73689c75f6c9318425500f9 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 13 Dec 2010 11:26:53 -0500 Subject: Fix dependency tracing of INSTALL and PACKAGE (#11598) Commit e01cce28 (Allow add_dependencies() on imported targets, 2010-11-19) started using cmMakefile::FindTargetToUse to follow dependencies, including those of GLOBAL_TARGETs like INSTALL and PACKAGE. Since global targets exist in every directory, dependencies between them must be traced within each directory too. Teach FindTargetToUse to check the current directory before checking globally. For global targets this will find the local copy. For for normal targets this will be a no-op because they are globally unique. --- Source/cmMakefile.cxx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 56e0ed9..9983e5d 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -3590,6 +3590,12 @@ cmTarget* cmMakefile::FindTargetToUse(const char* name) return imported->second; } + // Look for a target built in this directory. + if(cmTarget* t = this->FindTarget(name)) + { + return t; + } + // Look for a target built in this project. return this->LocalGenerator->GetGlobalGenerator()->FindTarget(0, name); } -- cgit v0.12