ENH: In cmMakefile::IssueMessage report the directory-level context even if no list file is currently being processed.

This commit is contained in:
Brad King 2008-04-29 14:17:28 -04:00
parent 2421c11a98
commit fb8c255c2d

View File

@ -299,12 +299,21 @@ void cmMakefile::IssueMessage(cmake::MessageType t,
} }
this->GetBacktrace(backtrace); this->GetBacktrace(backtrace);
} }
else if(!this->ListFileStack.empty()) else
{
cmListFileContext lfc;
if(this->ListFileStack.empty())
{
// We are not processing the project. Add the directory-level context.
lfc.FilePath = this->GetCurrentDirectory();
lfc.FilePath += "/CMakeLists.txt";
}
else
{ {
// We are processing the project but are not currently executing a // We are processing the project but are not currently executing a
// command. Add whatever context information we have. // command. Add whatever context information we have.
cmListFileContext lfc;
lfc.FilePath = this->ListFileStack.back(); lfc.FilePath = this->ListFileStack.back();
}
lfc.Line = 0; lfc.Line = 0;
if(!this->GetCMakeInstance()->GetIsInTryCompile()) if(!this->GetCMakeInstance()->GetIsInTryCompile())
{ {