summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
authorAlexander Neundorf <neundorf@kde.org>2007-05-01 15:46:47 (GMT)
committerAlexander Neundorf <neundorf@kde.org>2007-05-01 15:46:47 (GMT)
commitef0b9ff2ccb1b40c23fb90d9feb36d261642eef1 (patch)
treed9b9f4f96bd1585ecde94ae1b4a78beacd93a57c /Source/cmMakefile.cxx
parentc7873ad44ad3a16dbc9a5207291193da1a15e6a9 (diff)
downloadCMake-ef0b9ff2ccb1b40c23fb90d9feb36d261642eef1.zip
CMake-ef0b9ff2ccb1b40c23fb90d9feb36d261642eef1.tar.gz
CMake-ef0b9ff2ccb1b40c23fb90d9feb36d261642eef1.tar.bz2
BUG: fix cmake listfile stack: if a file could not be opened, remove it from
the stack (usually CMakeCInformation.cmake and CMakeCXXInformation.cmake which both put Linux-gcc.cmake on the stack without removing it again: INCLUDE(... OPTIONAL) ) STYLE: better readable output formatting of the listfile stack, now in the same order as in gdb or with include files Alex
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r--Source/cmMakefile.cxx25
1 files changed, 15 insertions, 10 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index a698b6a..e8a6eb9 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -446,10 +446,12 @@ bool cmMakefile::ReadListFile(const char* filename_in,
// push the listfile onto the stack
this->ListFileStack.push_back(filenametoread);
-
+
cmListFile cacheFile;
if( !cacheFile.ParseFile(filenametoread, requireProjectCommand) )
{
+ // pop the listfile off the stack
+ this->ListFileStack.pop_back();
this->AddDefinition("CMAKE_PARENT_LIST_FILE", currentParentFile.c_str());
this->AddDefinition("CMAKE_CURRENT_LIST_FILE", currentFile.c_str());
return false;
@@ -2753,17 +2755,20 @@ std::vector<cmTest*> *cmMakefile::GetTests()
std::string cmMakefile::GetListFileStack()
{
- std::string tmp;
- for (std::deque<cmStdString>::iterator i = this->ListFileStack.begin();
- i != this->ListFileStack.end(); ++i)
+ cmOStringStream tmp;
+ unsigned int depth = this->ListFileStack.size();
+ std::deque<cmStdString>::iterator it = this->ListFileStack.end();
+ do
{
- if (i != this->ListFileStack.begin())
- {
- tmp += ";";
- }
- tmp += *i;
+ --it;
+ tmp << "\n[";
+ tmp << depth;
+ tmp << "]\t";
+ tmp << *it;
+ depth--;
}
- return tmp;
+ while (it != this->ListFileStack.begin());
+ return tmp.str();
}
// define properties