summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2003-06-04 18:01:46 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2003-06-04 18:01:46 (GMT)
commit11a698558e1445c7f57d5b600c584fe7acc4b2e5 (patch)
tree94b257f8f28c65a0cae8c08b5b63d6cd548ad35c
parent620b832da39fe23209baf41f3daa19f366f1dbad (diff)
downloadCMake-11a698558e1445c7f57d5b600c584fe7acc4b2e5.zip
CMake-11a698558e1445c7f57d5b600c584fe7acc4b2e5.tar.gz
CMake-11a698558e1445c7f57d5b600c584fe7acc4b2e5.tar.bz2
better error reporting
-rw-r--r--Source/cmMakefile.cxx14
1 files changed, 10 insertions, 4 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 2e9ef62..c5eb0fa 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -465,15 +465,22 @@ void cmMakefile::AddCustomCommand(const char* source,
sname += ".rule";
if (!this->GetSource(sname.c_str()))
{
- m_Targets[target].GetSourceLists().push_back(source);
+ if (m_Targets.find(target) != m_Targets.end())
+ {
+ m_Targets[target].GetSourceLists().push_back(source);
+ }
+ else
+ {
+ cmSystemTools::Error("Attempt to add a custom rule to a target that does not exist yet for target ", target);
+ return;
+ }
}
}
}
else
{
this->AddCustomCommandToTarget(target, command, commandArgs,
- cmTarget::POST_BUILD,
- comment);
+ cmTarget::POST_BUILD, comment);
}
}
@@ -931,7 +938,6 @@ void cmMakefile::AddExecutable(const char *exeName,
this->AddGlobalLinkInformation(exeName, target);
m_Targets.insert(cmTargets::value_type(exeName,target));
-
// Add an entry into the cache
std::string exePath = exeName;
exePath += "_CMAKE_PATH";