summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2008-03-10 19:40:57 (GMT)
committerBrad King <brad.king@kitware.com>2008-03-10 19:40:57 (GMT)
commiteb6b300978abf63c3770ada4ffce0304231b5a91 (patch)
tree8b85b6eda2eb59184ee1ec7cd6893103bdb8aba5 /Source
parentee72506471859d62e2ef9f76ea44bda8e316e78d (diff)
downloadCMake-eb6b300978abf63c3770ada4ffce0304231b5a91.zip
CMake-eb6b300978abf63c3770ada4ffce0304231b5a91.tar.gz
CMake-eb6b300978abf63c3770ada4ffce0304231b5a91.tar.bz2
ENH: Add directory-level context information to error/warning messages when no call stack is present.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmMakefile.cxx15
1 files changed, 15 insertions, 0 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index f50cbf7..12ff1b6 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -325,6 +325,21 @@ void cmMakefile::IssueMessage(std::string const& text, bool isError) const
<< ":" << lfc.Line << " " << lfc.Name;
++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.
{