diff --git a/Source/cmDocumentVariables.cxx b/Source/cmDocumentVariables.cxx index b8520a402..fb7f11685 100644 --- a/Source/cmDocumentVariables.cxx +++ b/Source/cmDocumentVariables.cxx @@ -214,6 +214,14 @@ void cmDocumentVariables::DefineVariables(cmake* cm) "This specifies the patch version of the CMake" " executable being run.",false, "Variables that Provide Information"); + cm->DefineProperty + ("CMAKE_VERSION", cmProperty::VARIABLE, + "The full version of cmake in major.minor.patch format.", + "This specifies the full version of the CMake executable being run. " + "This variable is defined by versions 2.6.3 and higher. " + "See variables CMAKE_MAJOR_VERSION, CMAKE_MINOR_VERSION, and " + "CMAKE_PATCH_VERSION for individual version components.", false, + "Variables that Provide Information"); cm->DefineProperty ("CMAKE_PARENT_LIST_FILE", cmProperty::VARIABLE, diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 74423185b..645de3741 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -2307,6 +2307,11 @@ void cmMakefile::AddDefaultDefinitions() this->AddDefinition("CMAKE_MAJOR_VERSION", temp); sprintf(temp, "%d", cmVersion::GetPatchVersion()); this->AddDefinition("CMAKE_PATCH_VERSION", temp); + sprintf(temp, "%u.%u.%u", + cmVersion::GetMajorVersion(), + cmVersion::GetMinorVersion(), + cmVersion::GetPatchVersion()); + this->AddDefinition("CMAKE_VERSION", temp); this->AddDefinition("CMAKE_FILES_DIRECTORY", cmake::GetCMakeFilesDirectory());