ENH: Improved error message for macro invoked with incorrect number of arguments.

This commit is contained in:
Brad King 2002-12-17 11:58:55 -05:00
parent a45217f2a2
commit a37a934410
1 changed files with 7 additions and 1 deletions

View File

@ -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.