ENH: Added error reporting for missing arguments to ENDIF.

This commit is contained in:
Brad King 2001-12-18 14:55:11 -05:00
parent 73fd2381b9
commit aa49d94ce0
1 changed files with 17 additions and 1 deletions

View File

@ -43,7 +43,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
bool cmIfFunctionBlocker:: bool cmIfFunctionBlocker::
IsFunctionBlocked(const char *name, const std::vector<std::string> &args, IsFunctionBlocked(const char *name, const std::vector<std::string> &args,
cmMakefile &) cmMakefile &mf)
{ {
if (!strcmp(name,"ELSE") || !strcmp(name,"ENDIF")) if (!strcmp(name,"ELSE") || !strcmp(name,"ENDIF"))
{ {
@ -51,6 +51,22 @@ IsFunctionBlocked(const char *name, const std::vector<std::string> &args,
{ {
return false; return false;
} }
else if(args.empty())
{
std::string err = "Empty arguments for ";
err += name;
err += ". Did you mean ";
err += name;
err += "( ";
for(std::vector<std::string>::const_iterator a = m_Args.begin();
a != m_Args.end();++a)
{
err += *a;
err += " ";
}
err += ")?";
cmSystemTools::Error(err.c_str());
}
} }
return true; return true;
} }