summaryrefslogtreecommitdiffstats
path: root/Source/cmAddDependenciesCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2010-11-19 18:36:11 (GMT)
committerBrad King <brad.king@kitware.com>2010-11-19 22:19:21 (GMT)
commite01cce28694201342adc97825982ed66fc52af65 (patch)
treeef4573c4112650f78df2ebb66665185118a8bcd6 /Source/cmAddDependenciesCommand.cxx
parentbc7395c096be40f8a0fecbab4aa7539c05898ef2 (diff)
downloadCMake-e01cce28694201342adc97825982ed66fc52af65.zip
CMake-e01cce28694201342adc97825982ed66fc52af65.tar.gz
CMake-e01cce28694201342adc97825982ed66fc52af65.tar.bz2
Allow add_dependencies() on imported targets (#10395)
Imported targets do not themselves build, but we can follow dependencies through them to find real targets. This allows imported targets to depend on custom targets that provide the underlying files at build time.
Diffstat (limited to 'Source/cmAddDependenciesCommand.cxx')
-rw-r--r--Source/cmAddDependenciesCommand.cxx6
1 files changed, 1 insertions, 5 deletions
diff --git a/Source/cmAddDependenciesCommand.cxx b/Source/cmAddDependenciesCommand.cxx
index 1205f07..a77140d 100644
--- a/Source/cmAddDependenciesCommand.cxx
+++ b/Source/cmAddDependenciesCommand.cxx
@@ -24,11 +24,7 @@ bool cmAddDependenciesCommand
}
std::string target_name = args[0];
-
- cmTarget* target =
- this->GetMakefile()->GetLocalGenerator()->
- GetGlobalGenerator()->FindTarget(0, target_name.c_str());
- if(target)
+ if(cmTarget* target = this->Makefile->FindTargetToUse(target_name.c_str()))
{
std::vector<std::string>::const_iterator s = args.begin();
++s; // skip over target_name