ENH: Add directory-level context information to error/warning messages when no call stack is present.

This commit is contained in:
Brad King 2008-03-10 15:40:57 -04:00
parent ee72506471
commit eb6b300978
1 changed files with 15 additions and 0 deletions

View File

@ -325,6 +325,21 @@ void cmMakefile::IssueMessage(std::string const& text, bool isError) const
<< ":" << lfc.Line << " " << lfc.Name; << ":" << lfc.Line << " " << lfc.Name;
++i; ++i;
} }
else if(!this->ListFileStack.empty())
{
// We are processing the project but are not currently executing a
// command. Add whatever context information we have.
if(this->LocalGenerator->GetParent())
{
msg << " in directory "
<< this->LocalGenerator->Convert(this->GetCurrentDirectory(),
cmLocalGenerator::HOME);
}
else
{
msg << " in top-level directory";
}
}
// Add the message text. // Add the message text.
{ {