diff options
author | Brad King <brad.king@kitware.com> | 2010-12-13 16:26:53 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2010-12-13 17:56:47 (GMT) |
commit | 0621362668af7b5ec73689c75f6c9318425500f9 (patch) | |
tree | 2673f0d0be0fb6269dba5f41860ee3e809d9e5db | |
parent | e01cce28694201342adc97825982ed66fc52af65 (diff) | |
download | CMake-0621362668af7b5ec73689c75f6c9318425500f9.zip CMake-0621362668af7b5ec73689c75f6c9318425500f9.tar.gz CMake-0621362668af7b5ec73689c75f6c9318425500f9.tar.bz2 |
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.
-rw-r--r-- | Source/cmMakefile.cxx | 6 |
1 files changed, 6 insertions, 0 deletions
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); } |