[Cmake-commits] [cmake-commits] king committed cmDocumentVariables.cxx 1.24 1.25 cmMakefile.cxx 1.488 1.489

cmake-commits at cmake.org cmake-commits at cmake.org
Thu Jan 15 08:57:46 EST 2009


Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv12088/Source

Modified Files:
	cmDocumentVariables.cxx cmMakefile.cxx 
Log Message:
ENH: Provide variable CMAKE_VERSION

This creates the variable CMAKE_VERSION containing the full version of
cmake in "major.minor.patch" format.  It is particularly useful with the
component-wise version comparison provided by the if() command.


Index: cmDocumentVariables.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmDocumentVariables.cxx,v
retrieving revision 1.24
retrieving revision 1.25
diff -C 2 -d -r1.24 -r1.25
*** cmDocumentVariables.cxx	15 Jan 2009 13:57:17 -0000	1.24
--- cmDocumentVariables.cxx	15 Jan 2009 13:57:44 -0000	1.25
***************
*** 215,218 ****
--- 215,226 ----
       " 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

Index: cmMakefile.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefile.cxx,v
retrieving revision 1.488
retrieving revision 1.489
diff -C 2 -d -r1.488 -r1.489
*** cmMakefile.cxx	5 Jan 2009 20:00:56 -0000	1.488
--- cmMakefile.cxx	15 Jan 2009 13:57:44 -0000	1.489
***************
*** 2308,2311 ****
--- 2308,2316 ----
    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",



More information about the Cmake-commits mailing list