diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmDocumentVariables.cxx | 19 | ||||
-rw-r--r-- | Source/cmMakefile.cxx | 6 |
2 files changed, 25 insertions, 0 deletions
diff --git a/Source/cmDocumentVariables.cxx b/Source/cmDocumentVariables.cxx index a1fb064..a877680 100644 --- a/Source/cmDocumentVariables.cxx +++ b/Source/cmDocumentVariables.cxx @@ -78,6 +78,25 @@ void cmDocumentVariables::DefineVariables(cmake* cm) "Variables that Provide Information"); cm->DefineProperty + ("CMAKE_CURRENT_LIST_DIR", cmProperty::VARIABLE, + "Full directory of the listfile currently being processed.", + "As CMake processes the listfiles in your project this " + "variable will always be set to the directory where the listfile which " + "is currently being processed (CMAKE_CURRENT_LIST_FILE) is located. " + "The value has dynamic scope. " + "When CMake starts processing commands in a source file " + "it sets this variable to the directory where this file is located. " + "When CMake finishes processing commands from the file it " + "restores the previous value. " + "Therefore the value of the variable inside a macro or " + "function is the directory of the file invoking the bottom-most entry on " + "the call stack, not the directory of the file containing the macro or " + "function definition." + "\n" + "See also CMAKE_CURRENT_LIST_FILE.",false, + "Variables that Provide Information"); + + cm->DefineProperty ("CMAKE_BUILD_TOOL", cmProperty::VARIABLE, "Tool used for the actual build process.", "This variable is set to the program that will be" 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(); |