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.
This commit is contained in:
parent
e01cce2869
commit
0621362668
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user