summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/cmDocumentVariables.cxx14
-rw-r--r--Source/cmMakefile.cxx8
-rw-r--r--Source/cmVersion.cxx3
-rw-r--r--Source/cmVersion.h1
-rw-r--r--Source/cmVersionConfig.h.in3
-rw-r--r--Source/cmVersionMacros.h19
6 files changed, 22 insertions, 26 deletions
diff --git a/Source/cmDocumentVariables.cxx b/Source/cmDocumentVariables.cxx
index c6f9ba5..b583021 100644
--- a/Source/cmDocumentVariables.cxx
+++ b/Source/cmDocumentVariables.cxx
@@ -251,12 +251,20 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
" executable being run.",false,
"Variables that Provide Information");
cm->DefineProperty
+ ("CMAKE_TWEAK_VERSION", cmProperty::VARIABLE,
+ "The tweak version of cmake (i.e. the 1 in X.X.X.1).",
+ "This specifies the tweak version of the CMake executable being run. "
+ "Releases use tweak < 20000000 and development versions use the date "
+ "format CCYYMMDD for the tweak level."
+ ,false, "Variables that Provide Information");
+ cm->DefineProperty
("CMAKE_VERSION", cmProperty::VARIABLE,
- "The full version of cmake in major.minor.patch format.",
+ "The full version of cmake in major.minor.patch[.tweak] 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,
+ "See variables CMAKE_MAJOR_VERSION, CMAKE_MINOR_VERSION, "
+ "CMAKE_PATCH_VERSION, and CMAKE_TWEAK_VERSION "
+ "for individual version components.", false,
"Variables that Provide Information");
cm->DefineProperty
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index d09188a..e51ee65 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -2368,11 +2368,9 @@ 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);
+ sprintf(temp, "%d", cmVersion::GetTweakVersion());
+ this->AddDefinition("CMAKE_TWEAK_VERSION", temp);
+ this->AddDefinition("CMAKE_VERSION", cmVersion::GetCMakeVersion());
this->AddDefinition("CMAKE_FILES_DIRECTORY",
cmake::GetCMakeFilesDirectory());
diff --git a/Source/cmVersion.cxx b/Source/cmVersion.cxx
index bde5f98..047d24d 100644
--- a/Source/cmVersion.cxx
+++ b/Source/cmVersion.cxx
@@ -16,8 +16,9 @@
unsigned int cmVersion::GetMajorVersion() { return CMake_VERSION_MAJOR; }
unsigned int cmVersion::GetMinorVersion() { return CMake_VERSION_MINOR; }
unsigned int cmVersion::GetPatchVersion() { return CMake_VERSION_PATCH; }
+unsigned int cmVersion::GetTweakVersion() { return CMake_VERSION_TWEAK; }
const char* cmVersion::GetCMakeVersion()
{
- return CMake_VERSION_FULL CMake_VERSION_RC_SUFFIX;
+ return CMake_VERSION;
}
diff --git a/Source/cmVersion.h b/Source/cmVersion.h
index f267ab6..e313524 100644
--- a/Source/cmVersion.h
+++ b/Source/cmVersion.h
@@ -28,6 +28,7 @@ public:
static unsigned int GetMajorVersion();
static unsigned int GetMinorVersion();
static unsigned int GetPatchVersion();
+ static unsigned int GetTweakVersion();
static const char* GetCMakeVersion();
};
diff --git a/Source/cmVersionConfig.h.in b/Source/cmVersionConfig.h.in
index ee6eca7..76bc8fe 100644
--- a/Source/cmVersionConfig.h.in
+++ b/Source/cmVersionConfig.h.in
@@ -12,4 +12,5 @@
#define CMake_VERSION_MAJOR @CMake_VERSION_MAJOR@
#define CMake_VERSION_MINOR @CMake_VERSION_MINOR@
#define CMake_VERSION_PATCH @CMake_VERSION_PATCH@
-#cmakedefine CMake_VERSION_RC @CMake_VERSION_RC@
+#define CMake_VERSION_TWEAK @CMake_VERSION_TWEAK@
+#define CMake_VERSION "@CMake_VERSION@"
diff --git a/Source/cmVersionMacros.h b/Source/cmVersionMacros.h
index 412db6d..67f58ca 100644
--- a/Source/cmVersionMacros.h
+++ b/Source/cmVersionMacros.h
@@ -14,22 +14,9 @@
#include "cmVersionConfig.h"
-#define CMAKE_TO_STRING(x) CMAKE_TO_STRING0(x)
-#define CMAKE_TO_STRING0(x) #x
-
-#define CMake_VERSION \
- CMAKE_TO_STRING(CMake_VERSION_MAJOR) "." \
- CMAKE_TO_STRING(CMake_VERSION_MINOR)
-
-#define CMake_VERSION_FULL \
- CMAKE_TO_STRING(CMake_VERSION_MAJOR) "." \
- CMAKE_TO_STRING(CMake_VERSION_MINOR) "." \
- CMAKE_TO_STRING(CMake_VERSION_PATCH)
-
-#if !(CMake_VERSION_MINOR & 1) && defined(CMake_VERSION_RC)
-# define CMake_VERSION_RC_SUFFIX "-rc" CMAKE_TO_STRING(CMake_VERSION_RC)
-#else
-# define CMake_VERSION_RC_SUFFIX ""
+#define CMake_VERSION_TWEAK_IS_RELEASE(tweak) ((tweak) < 20000000)
+#if CMake_VERSION_TWEAK_IS_RELEASE(CMake_VERSION_TWEAK)
+# define CMake_VERSION_IS_RELEASE 1
#endif
#endif