diff options
author | Alex Neundorf <neundorf@kde.org> | 2010-09-28 20:09:14 (GMT) |
---|---|---|
committer | Alex Neundorf <neundorf@kde.org> | 2010-09-28 20:10:47 (GMT) |
commit | 41e4f1a2109cc03008ef0d1db5cab1c9345866e3 (patch) | |
tree | 588fe929d70a87772f0cf48a3295cdef4bb5e489 /Source/cmMakefile.cxx | |
parent | f9fc79cac54b1d97afb65075b949bac264961439 (diff) | |
download | CMake-41e4f1a2109cc03008ef0d1db5cab1c9345866e3.zip CMake-41e4f1a2109cc03008ef0d1db5cab1c9345866e3.tar.gz CMake-41e4f1a2109cc03008ef0d1db5cab1c9345866e3.tar.bz2 |
Add automatic variable CMAKE_CURRENT_LIST_DIR(dir of CMAKE_CURRENT_LIST_FILE)
Comes with a simple test and docs.
Alex
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r-- | Source/cmMakefile.cxx | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index a69fee7..e32619a 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -610,6 +610,8 @@ bool cmMakefile::ReadListFile(const char* filename_in, } this->AddDefinition("CMAKE_CURRENT_LIST_FILE", filenametoread); + this->AddDefinition("CMAKE_CURRENT_LIST_DIR", + cmSystemTools::GetFilenamePath(filenametoread).c_str()); // try to see if the list file is the top most // list file for a project, and if it is, then it @@ -643,6 +645,8 @@ bool cmMakefile::ReadListFile(const char* filename_in, } this->AddDefinition("CMAKE_PARENT_LIST_FILE", currentParentFile.c_str()); this->AddDefinition("CMAKE_CURRENT_LIST_FILE", currentFile.c_str()); + this->AddDefinition("CMAKE_CURRENT_LIST_DIR", + cmSystemTools::GetFilenamePath(currentFile).c_str()); return false; } // add this list file to the list of dependencies @@ -683,6 +687,8 @@ bool cmMakefile::ReadListFile(const char* filename_in, this->AddDefinition("CMAKE_PARENT_LIST_FILE", currentParentFile.c_str()); this->AddDefinition("CMAKE_CURRENT_LIST_FILE", currentFile.c_str()); + this->AddDefinition("CMAKE_CURRENT_LIST_DIR", + cmSystemTools::GetFilenamePath(currentFile).c_str()); // pop the listfile off the stack this->ListFileStack.pop_back(); |