summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2006-06-22 19:31:19 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2006-06-22 19:31:19 (GMT)
commit99f4edb4e40501625788c5c1e2db1bb3bbe5c3ba (patch)
tree27d0499efdc62958402336f2133e51969e5d7206 /Source/cmMakefile.cxx
parent847c3a58494665dd47fe57a027df00ad7d16159d (diff)
downloadCMake-99f4edb4e40501625788c5c1e2db1bb3bbe5c3ba.zip
CMake-99f4edb4e40501625788c5c1e2db1bb3bbe5c3ba.tar.gz
CMake-99f4edb4e40501625788c5c1e2db1bb3bbe5c3ba.tar.bz2
ENH: DIsplay the list file stack when displaying errors
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r--Source/cmMakefile.cxx20
1 files changed, 18 insertions, 2 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 1c8e72a..5251b4d 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -267,7 +267,8 @@ bool cmMakefile::ExecuteCommand(const cmListFileFunction& lff)
cmOStringStream error;
error << "Error in cmake code at\n"
<< lff.FilePath << ":" << lff.Line << ":\n"
- << rm->GetError();
+ << rm->GetError() << std::endl
+ << "Current CMake stack: " << this->GetListFileStack().c_str();
cmSystemTools::Error(error.str().c_str());
return false;
}
@@ -283,7 +284,8 @@ bool cmMakefile::ExecuteCommand(const cmListFileFunction& lff)
cmOStringStream error;
error << "Error in cmake code at\n"
<< lff.FilePath << ":" << lff.Line << ":\n"
- << usedCommand->GetError();
+ << usedCommand->GetError() << std::endl
+ << "Current CMake stack: " << this->GetListFileStack().c_str();
cmSystemTools::Error(error.str().c_str());
result = false;
if ( this->GetCMakeInstance()->GetScriptMode() )
@@ -2743,3 +2745,17 @@ std::vector<cmTest*> *cmMakefile::GetTests()
return &this->Tests;
}
+std::string cmMakefile::GetListFileStack()
+{
+ std::string tmp;
+ for (std::deque<cmStdString>::iterator i = this->ListFileStack.begin();
+ i != this->ListFileStack.end(); ++i)
+ {
+ if (i != this->ListFileStack.begin())
+ {
+ tmp += ";";
+ }
+ tmp += *i;
+ }
+ return tmp;
+}