summaryrefslogtreecommitdiff
path: root/Source/cmAddDependenciesCommand.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2001-12-27 13:55:05 -0500
committerBill Hoffman <bill.hoffman@kitware.com>2001-12-27 13:55:05 -0500
commit445f122a92bcd46cc3b5e1e0fc0cf1fb3ecc8d45 (patch)
treeaec7f98ea828d1422f761b3bcad2ce488af9d6df /Source/cmAddDependenciesCommand.cxx
parent3d24bc75bd88174d00afd17629ab6f5d6849f3ac (diff)
downloadcmake-445f122a92bcd46cc3b5e1e0fc0cf1fb3ecc8d45.tar.gz
ENH: add error checking
Diffstat (limited to 'Source/cmAddDependenciesCommand.cxx')
-rw-r--r--Source/cmAddDependenciesCommand.cxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/Source/cmAddDependenciesCommand.cxx b/Source/cmAddDependenciesCommand.cxx
index 5b2cc6edb7..99cca8d554 100644
--- a/Source/cmAddDependenciesCommand.cxx
+++ b/Source/cmAddDependenciesCommand.cxx
@@ -66,6 +66,22 @@ bool cmAddDependenciesCommand::InitialPass(std::vector<std::string> const& args)
tgts[target_name].AddUtility(depend_target.c_str());
}
}
+ else
+ {
+ std::cerr << "existing targets are:";
+
+ for(cmTargets::iterator i = tgts.begin();
+ i != tgts.end(); ++i)
+ {
+ std::cerr << i->first << std::endl;
+ }
+
+ std::string error = "Adding dependency to non-existent target: ";
+ error += target_name;
+ this->SetError(error.c_str());
+ return false;
+ }
+
return true;
}