diff options
author | Brad King <brad.king@kitware.com> | 2014-02-19 14:15:42 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-02-19 14:30:13 (GMT) |
commit | 7cbab178718de26575fe98144e7e388b2f6735a6 (patch) | |
tree | 98e1e191a8687646dae44bd508f9b6f02d097666 /Source | |
parent | 4bb80396e09882dcb8bc0feb10de88351eb55e68 (diff) | |
download | CMake-7cbab178718de26575fe98144e7e388b2f6735a6.zip CMake-7cbab178718de26575fe98144e7e388b2f6735a6.tar.gz CMake-7cbab178718de26575fe98144e7e388b2f6735a6.tar.bz2 |
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.cmake | 8 | ||||
-rwxr-xr-x | Source/CMakeVersion.bash | 2 | ||||
-rw-r--r-- | Source/CMakeVersion.cmake | 1 | ||||
-rw-r--r-- | Source/CMakeVersionCompute.cmake | 7 | ||||
-rw-r--r-- | Source/cmExportFileGenerator.h | 13 | ||||
-rw-r--r-- | Source/cmVersion.cxx | 2 | ||||
-rw-r--r-- | Source/cmVersionConfig.h.in | 1 | ||||
-rw-r--r-- | Source/cmVersionMacros.h | 4 |
8 files changed, 16 insertions, 22 deletions
diff --git a/Source/CMakeInstallDestinations.cmake b/Source/CMakeInstallDestinations.cmake index 3e93d41..99c86ca 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 4794e60..853b0ca 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 547aca8..5ce43f5 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 a166334..496d6cf 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 8be4bbf..57ab378 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 047d24d..9cb0cd6 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 76bc8fe..16aeabe 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 67f58ca..cf7f678 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 |