summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2007-04-04 16:05:10 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2007-04-04 16:05:10 (GMT)
commit6fb9e2781a00d237162dcc617e04d8aaedb6a10f (patch)
treee700c5283867520894318535792ba2ca410230b8
parent2c1204e36167ef31bd8443fb46e0e540b425a61c (diff)
downloadCMake-6fb9e2781a00d237162dcc617e04d8aaedb6a10f.zip
CMake-6fb9e2781a00d237162dcc617e04d8aaedb6a10f.tar.gz
CMake-6fb9e2781a00d237162dcc617e04d8aaedb6a10f.tar.bz2
ENH: Add variable for the current list file
-rw-r--r--Source/cmMakefile.cxx17
1 files changed, 13 insertions, 4 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index e5dc29b..9bd85e2 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -372,7 +372,10 @@ bool cmMakefile::ExecuteCommand(const cmListFileFunction& lff)
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 @@ bool cmMakefile::ReadListFile(const char* filename_in,
{
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 @@ bool cmMakefile::ReadListFile(const char* filename_in,
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 @@ bool cmMakefile::ReadListFile(const char* filename_in,
{
// 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 @@ bool cmMakefile::ReadListFile(const char* filename_in,
}
}
- 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();