From 445f122a92bcd46cc3b5e1e0fc0cf1fb3ecc8d45 Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Thu, 27 Dec 2001 13:55:05 -0500 Subject: ENH: add error checking --- Source/cmAddDependenciesCommand.cxx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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 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; } -- cgit v1.2.1