summaryrefslogtreecommitdiffstats
path: root/Source/cmVersion.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-03-05 20:17:07 (GMT)
committerBrad King <brad.king@kitware.com>2009-03-05 20:17:07 (GMT)
commit98c51ff6dcd5e6aa80050cfc00f19eb6092e79c0 (patch)
tree8aabdbd5936493a3808cf1184620ebf08ef1d8ff /Source/cmVersion.cxx
parent83f39ba41b2c8969db2b44761d5fed363dc170b5 (diff)
downloadCMake-98c51ff6dcd5e6aa80050cfc00f19eb6092e79c0.zip
CMake-98c51ff6dcd5e6aa80050cfc00f19eb6092e79c0.tar.gz
CMake-98c51ff6dcd5e6aa80050cfc00f19eb6092e79c0.tar.bz2
ENH: Overhaul CMake version numbering
This moves the version numbers into an isolated configured header so that not all of CMake needs to rebuild when the version changes. Previously we had spaces, dashes and/or the word 'patch' randomly chosen before the patch number. Now we always report version numbers in the traditional format "<major>.<minor>.<patch>[-rc<rc>]". We still use odd minor numbers for development versions. Now we also use the CCYYMMDD date as the patch number of development versions, thus allowing tests for exact CMake versions.
Diffstat (limited to 'Source/cmVersion.cxx')
-rw-r--r--Source/cmVersion.cxx26
1 files changed, 6 insertions, 20 deletions
diff --git a/Source/cmVersion.cxx b/Source/cmVersion.cxx
index 77b19aa..0518c1f 100644
--- a/Source/cmVersion.cxx
+++ b/Source/cmVersion.cxx
@@ -16,27 +16,13 @@
=========================================================================*/
#include "cmVersion.h"
-#include <cmsys/DateStamp.h>
+#include "cmVersionMacros.h"
-std::string cmVersion::GetReleaseVersion()
-{
-#if CMake_VERSION_MINOR & 1
- return cmsys_DATE_STAMP_STRING_FULL;
-#else
-# ifdef CMake_VERSION_RC
- return "patch " CMAKE_TO_STRING(CMake_VERSION_PATCH) " RC-"
- CMAKE_TO_STRING(CMake_VERSION_RC);
-# else
- return "patch " CMAKE_TO_STRING(CMake_VERSION_PATCH);
-# endif
-#endif
-}
+unsigned int cmVersion::GetMajorVersion() { return CMake_VERSION_MAJOR; }
+unsigned int cmVersion::GetMinorVersion() { return CMake_VERSION_MINOR; }
+unsigned int cmVersion::GetPatchVersion() { return CMake_VERSION_PATCH; }
-std::string cmVersion::GetCMakeVersion()
+const char* cmVersion::GetCMakeVersion()
{
- cmOStringStream str;
- str << CMake_VERSION_MAJOR << "." << CMake_VERSION_MINOR
- << "-"
- << cmVersion::GetReleaseVersion();
- return str.str();
+ return CMake_VERSION_FULL CMake_VERSION_RC_SUFFIX;
}