summaryrefslogtreecommitdiff
path: root/Source/cmAddDependenciesCommand.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2007-02-07 11:49:42 -0500
committerBill Hoffman <bill.hoffman@kitware.com>2007-02-07 11:49:42 -0500
commitcbe95dffccb75692fcba71ca3c7835e1b3f286bd (patch)
tree757e9fdc74ba9b193e05abf0c521e3956585b21c /Source/cmAddDependenciesCommand.cxx
parentf548dc4a06bdac0507cce22b26d5058878de8044 (diff)
downloadcmake-cbe95dffccb75692fcba71ca3c7835e1b3f286bd.tar.gz
BUG: fix for bug 4414, find targets in the global generator for set_target_properties and add_dependencies
Diffstat (limited to 'Source/cmAddDependenciesCommand.cxx')
-rw-r--r--Source/cmAddDependenciesCommand.cxx13
1 files changed, 8 insertions, 5 deletions
diff --git a/Source/cmAddDependenciesCommand.cxx b/Source/cmAddDependenciesCommand.cxx
index d994073286..874c81695e 100644
--- a/Source/cmAddDependenciesCommand.cxx
+++ b/Source/cmAddDependenciesCommand.cxx
@@ -15,6 +15,8 @@
=========================================================================*/
#include "cmAddDependenciesCommand.h"
+#include "cmLocalGenerator.h"
+#include "cmGlobalGenerator.h"
// cmDependenciesCommand
bool cmAddDependenciesCommand::InitialPass(
@@ -28,14 +30,16 @@ bool cmAddDependenciesCommand::InitialPass(
std::string target_name = args[0];
- cmTargets &tgts = this->Makefile->GetTargets();
- if (tgts.find(target_name) != tgts.end())
+ cmTarget* target =
+ this->GetMakefile()->GetLocalGenerator()->
+ GetGlobalGenerator()->FindTarget(0, target_name.c_str());
+ if(target)
{
std::vector<std::string>::const_iterator s = args.begin();
- ++s;
+ ++s; // skip over target_name
for (; s != args.end(); ++s)
{
- tgts[target_name].AddUtility(s->c_str());
+ target->AddUtility(s->c_str());
}
}
else
@@ -46,7 +50,6 @@ bool cmAddDependenciesCommand::InitialPass(
return false;
}
-
return true;
}