summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-02-19 09:15:42 -0500
committerBrad King <brad.king@kitware.com>2014-02-19 09:30:13 -0500
commit7cbab178718de26575fe98144e7e388b2f6735a6 (patch)
tree98e1e191a8687646dae44bd508f9b6f02d097666 /Source
parent4bb80396e09882dcb8bc0feb10de88351eb55e68 (diff)
downloadcmake-7cbab178718de26575fe98144e7e388b2f6735a6.tar.gz
Change version scheme to use only two components for feature levels
Historically CMake used three version components for the feature level. We released new features while incrementing only the third version component. Since commit v2.8.2~105^2~4 (New version scheme to support branchy workflow, 2010-04-23) we used the fourth version component for bug-fix releases and the development date: <major>.<minor>.<patch>[.<tweak>][-rc<n>] = Release <major>.<minor>.<patch>.<date>[-<id>] = Development This solidified use of three components for the feature level, and was necessary to continue releasing 2.x versions because: * Some existing projects performed floating-point comparisons of ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} to 2.x numbers so ``x`` could never be higher than 9. * Version 2.9.<date> was used briefly in post-2.8.0 development in CVS prior to the transition to Git, so using it in releases may have caused confusion. Now that we are moving to 3.x versions, these two restrictions go away. Therefore we now change to use only two components for the feature level and use the scheme: <major>.<minor>.<patch>[-rc<n>] = Release <major>.<minor>.<date>[-<id>] = Development
Diffstat (limited to 'Source')
-rw-r--r--Source/CMakeInstallDestinations.cmake8
-rwxr-xr-xSource/CMakeVersion.bash2
-rw-r--r--Source/CMakeVersion.cmake1
-rw-r--r--Source/CMakeVersionCompute.cmake7
-rw-r--r--Source/cmExportFileGenerator.h13
-rw-r--r--Source/cmVersion.cxx2
-rw-r--r--Source/cmVersionConfig.h.in1
-rw-r--r--Source/cmVersionMacros.h4
8 files changed, 16 insertions, 22 deletions
diff --git a/Source/CMakeInstallDestinations.cmake b/Source/CMakeInstallDestinations.cmake
index 3e93d41e62..99c86ca77b 100644
--- a/Source/CMakeInstallDestinations.cmake
+++ b/Source/CMakeInstallDestinations.cmake
@@ -1,15 +1,15 @@
# Keep formatting here consistent with bootstrap script expectations.
if(BEOS)
- set(CMAKE_DATA_DIR_DEFAULT "share/cmake-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMake_VERSION_PATCH}") # HAIKU
+ set(CMAKE_DATA_DIR_DEFAULT "share/cmake-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}") # HAIKU
set(CMAKE_MAN_DIR_DEFAULT "documentation/man") # HAIKU
- set(CMAKE_DOC_DIR_DEFAULT "documentation/doc/cmake-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMake_VERSION_PATCH}") # HAIKU
+ set(CMAKE_DOC_DIR_DEFAULT "documentation/doc/cmake-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}") # HAIKU
elseif(CYGWIN)
set(CMAKE_DATA_DIR_DEFAULT "share/cmake-${CMake_VERSION}") # CYGWIN
set(CMAKE_DOC_DIR_DEFAULT "share/doc/cmake-${CMake_VERSION}") # CYGWIN
set(CMAKE_MAN_DIR_DEFAULT "share/man") # CYGWIN
else()
- set(CMAKE_DATA_DIR_DEFAULT "share/cmake-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMake_VERSION_PATCH}") # OTHER
- set(CMAKE_DOC_DIR_DEFAULT "doc/cmake-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMake_VERSION_PATCH}") # OTHER
+ set(CMAKE_DATA_DIR_DEFAULT "share/cmake-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}") # OTHER
+ set(CMAKE_DOC_DIR_DEFAULT "doc/cmake-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}") # OTHER
set(CMAKE_MAN_DIR_DEFAULT "man") # OTHER
endif()
diff --git a/Source/CMakeVersion.bash b/Source/CMakeVersion.bash
index 4794e608dc..853b0ca288 100755
--- a/Source/CMakeVersion.bash
+++ b/Source/CMakeVersion.bash
@@ -3,5 +3,5 @@
if test "x$1" = "x-f"; then shift ; n='*' ; else n='\{8\}' ; fi
if test "$#" -gt 0; then echo 1>&2 "usage: CMakeVersion.bash [-f]"; exit 1; fi
sed -i -e '
-s/\(^set(CMake_VERSION_TWEAK\) [0-9]'"$n"'\(.*\)/\1 '"$(date +%Y%m%d)"'\2/
+s/\(^set(CMake_VERSION_PATCH\) [0-9]'"$n"'\(.*\)/\1 '"$(date +%Y%m%d)"'\2/
' "${BASH_SOURCE%/*}/CMakeVersion.cmake"
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 547aca84cc..5ce43f56cf 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -2,5 +2,4 @@
set(CMake_VERSION_MAJOR 3)
set(CMake_VERSION_MINOR 0)
set(CMake_VERSION_PATCH 0)
-set(CMake_VERSION_TWEAK 0)
set(CMake_VERSION_RC 1)
diff --git a/Source/CMakeVersionCompute.cmake b/Source/CMakeVersionCompute.cmake
index a1663342ef..496d6cf1a4 100644
--- a/Source/CMakeVersionCompute.cmake
+++ b/Source/CMakeVersionCompute.cmake
@@ -1,8 +1,8 @@
# Load version number components.
include(${CMake_SOURCE_DIR}/Source/CMakeVersion.cmake)
-# Releases define a small tweak level.
-if("${CMake_VERSION_TWEAK}" VERSION_LESS 20000000)
+# Releases define a small patch level.
+if("${CMake_VERSION_PATCH}" VERSION_LESS 20000000)
set(CMake_VERSION_IS_RELEASE 1)
set(CMake_VERSION_SOURCE "")
else()
@@ -12,9 +12,6 @@ endif()
# Compute the full version string.
set(CMake_VERSION ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMake_VERSION_PATCH})
-if(${CMake_VERSION_TWEAK} GREATER 0)
- set(CMake_VERSION ${CMake_VERSION}.${CMake_VERSION_TWEAK})
-endif()
if(CMake_VERSION_RC)
set(CMake_VERSION ${CMake_VERSION}-rc${CMake_VERSION_RC})
endif()
diff --git a/Source/cmExportFileGenerator.h b/Source/cmExportFileGenerator.h
index 8be4bbf8b7..57ab378998 100644
--- a/Source/cmExportFileGenerator.h
+++ b/Source/cmExportFileGenerator.h
@@ -21,14 +21,13 @@
#define STRINGIFY_HELPER(X) #X
#define STRINGIFY(X) STRINGIFY_HELPER(X)
-#define DEVEL_CMAKE_VERSION(maj, min, patch) \
- (CMake_VERSION_ENCODE(maj, min, patch) > \
- CMake_VERSION_ENCODE(CMake_VERSION_MAJOR, CMake_VERSION_MINOR, \
- CMake_VERSION_PATCH) \
- ) ? \
+#define DEVEL_CMAKE_VERSION(major, minor) ( \
+ CMake_VERSION_ENCODE(major, minor, 0) > \
+ CMake_VERSION_ENCODE(CMake_VERSION_MAJOR, CMake_VERSION_MINOR, 0) ? \
STRINGIFY(CMake_VERSION_MAJOR) "." STRINGIFY(CMake_VERSION_MINOR) "." \
- STRINGIFY(CMake_VERSION_PATCH) "." STRINGIFY(CMake_VERSION_TWEAK) \
- : #maj "." #min "." #patch
+ STRINGIFY(CMake_VERSION_PATCH) \
+ : #major "." #minor ".0" \
+ )
class cmTargetExport;
diff --git a/Source/cmVersion.cxx b/Source/cmVersion.cxx
index 047d24d742..9cb0cd6a7f 100644
--- a/Source/cmVersion.cxx
+++ b/Source/cmVersion.cxx
@@ -16,7 +16,7 @@
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; }
+unsigned int cmVersion::GetTweakVersion() { return 0; }
const char* cmVersion::GetCMakeVersion()
{
diff --git a/Source/cmVersionConfig.h.in b/Source/cmVersionConfig.h.in
index 76bc8fe946..16aeabe9e5 100644
--- a/Source/cmVersionConfig.h.in
+++ b/Source/cmVersionConfig.h.in
@@ -12,5 +12,4 @@
#define CMake_VERSION_MAJOR @CMake_VERSION_MAJOR@
#define CMake_VERSION_MINOR @CMake_VERSION_MINOR@
#define CMake_VERSION_PATCH @CMake_VERSION_PATCH@
-#define CMake_VERSION_TWEAK @CMake_VERSION_TWEAK@
#define CMake_VERSION "@CMake_VERSION@"
diff --git a/Source/cmVersionMacros.h b/Source/cmVersionMacros.h
index 67f58ca411..cf7f678a78 100644
--- a/Source/cmVersionMacros.h
+++ b/Source/cmVersionMacros.h
@@ -14,8 +14,8 @@
#include "cmVersionConfig.h"
-#define CMake_VERSION_TWEAK_IS_RELEASE(tweak) ((tweak) < 20000000)
-#if CMake_VERSION_TWEAK_IS_RELEASE(CMake_VERSION_TWEAK)
+#define CMake_VERSION_PATCH_IS_RELEASE(patch) ((patch) < 20000000)
+#if CMake_VERSION_PATCH_IS_RELEASE(CMake_VERSION_PATCH)
# define CMake_VERSION_IS_RELEASE 1
#endif