summaryrefslogtreecommitdiffstats
path: root/Source/cmMacroCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2002-12-17 16:58:55 (GMT)
committerBrad King <brad.king@kitware.com>2002-12-17 16:58:55 (GMT)
commita37a934410aeecc172fe156d26daecca5fabfd72 (patch)
tree924ea48d4baa17a1b2b0c0e219a7602ae01593e4 /Source/cmMacroCommand.cxx
parenta45217f2a2e76c387eaa02c9a05e03bb924c14c5 (diff)
downloadCMake-a37a934410aeecc172fe156d26daecca5fabfd72.zip
CMake-a37a934410aeecc172fe156d26daecca5fabfd72.tar.gz
CMake-a37a934410aeecc172fe156d26daecca5fabfd72.tar.bz2
ENH: Improved error message for macro invoked with incorrect number of arguments.
Diffstat (limited to 'Source/cmMacroCommand.cxx')
-rw-r--r--Source/cmMacroCommand.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx
index f8746d0..230683e 100644
--- a/Source/cmMacroCommand.cxx
+++ b/Source/cmMacroCommand.cxx
@@ -50,7 +50,13 @@ IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf)
// make sure the number of arguments matches
if (expandedArguments.size() != m_Args.size() - 1)
{
- cmSystemTools::Error("A macro was invoked without the correct number of arguments. The macro name was: ", m_Args[0].c_str());
+ cmOStringStream error;
+ error << "Error in cmake code at\n"
+ << lff.m_FilePath << ":" << lff.m_Line << ":\n"
+ << "Invocation of macro \""
+ << lff.m_Name.c_str() << "\" with incorrect number of arguments.";
+ cmSystemTools::Error(error.str().c_str());
+ return true;
}
// Invoke all the functions that were collected in the block.