[cmake-commits] alex committed cmMakefile.cxx 1.383 1.384
cmake-commits at cmake.org
cmake-commits at cmake.org
Tue May 1 11:46:50 EDT 2007
Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv8072
Modified Files:
cmMakefile.cxx
Log Message:
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
Index: cmMakefile.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefile.cxx,v
retrieving revision 1.383
retrieving revision 1.384
diff -u -d -r1.383 -r1.384
--- cmMakefile.cxx 11 Apr 2007 19:13:05 -0000 1.383
+++ cmMakefile.cxx 1 May 2007 15:46:47 -0000 1.384
@@ -446,10 +446,12 @@
// 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::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
More information about the Cmake-commits
mailing list