[cmake-commits] andy committed cmMakefile.cxx 1.380 1.381
cmake-commits at cmake.org
cmake-commits at cmake.org
Wed Apr 4 12:05:12 EDT 2007
Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv30305/Source
Modified Files:
cmMakefile.cxx
Log Message:
ENH: Add variable for the current list file
Index: cmMakefile.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefile.cxx,v
retrieving revision 1.380
retrieving revision 1.381
diff -u -d -r1.380 -r1.381
--- cmMakefile.cxx 22 Mar 2007 13:45:24 -0000 1.380
+++ cmMakefile.cxx 4 Apr 2007 16:05:10 -0000 1.381
@@ -372,7 +372,10 @@
bool cmMakefile::ReadListFile(const char* filename_in,
const char *external_in)
{
- std::string currentFile = this->GetSafeDefinition("CMAKE_PARENT_LIST_FILE");
+ std::string currentParentFile
+ = this->GetSafeDefinition("CMAKE_PARENT_LIST_FILE");
+ std::string currentFile
+ = this->GetSafeDefinition("CMAKE_CURRENT_LIST_FILE");
this->AddDefinition("CMAKE_PARENT_LIST_FILE", filename_in);
// used to watch for blockers going out of scope
@@ -423,6 +426,9 @@
{
filenametoread= external;
}
+
+ this->AddDefinition("CMAKE_CURRENT_LIST_FILE", filenametoread);
+
// try to see if the list file is the top most
// list file for a project, and if it is, then it
// must have a project command. If there is not
@@ -444,7 +450,8 @@
cmListFile cacheFile;
if( !cacheFile.ParseFile(filenametoread, requireProjectCommand) )
{
- this->AddDefinition("CMAKE_PARENT_LIST_FILE", currentFile.c_str());
+ this->AddDefinition("CMAKE_PARENT_LIST_FILE", currentParentFile.c_str());
+ this->AddDefinition("CMAKE_CURRENT_LIST_FILE", currentFile.c_str());
return false;
}
// add this list file to the list of dependencies
@@ -457,7 +464,8 @@
{
// pop the listfile off the stack
this->ListFileStack.pop_back();
- this->AddDefinition("CMAKE_PARENT_LIST_FILE", currentFile.c_str());
+ this->AddDefinition("CMAKE_PARENT_LIST_FILE", currentParentFile.c_str());
+ this->AddDefinition("CMAKE_CURRENT_LIST_FILE", currentFile.c_str());
return true;
}
}
@@ -479,7 +487,8 @@
}
}
- this->AddDefinition("CMAKE_PARENT_LIST_FILE", currentFile.c_str());
+ this->AddDefinition("CMAKE_PARENT_LIST_FILE", currentParentFile.c_str());
+ this->AddDefinition("CMAKE_CURRENT_LIST_FILE", currentFile.c_str());
// pop the listfile off the stack
this->ListFileStack.pop_back();
More information about the Cmake-commits
mailing list