CMake: tweak version-handling
- separate out the version into a variable (again -- this was moved **into** project() long ago, but now there's a desire to have the value before reaching the project() command) - rename CALAMARES_VERSION_RC to something more sensible.
This commit is contained in:
parent
61f579b591
commit
2be9aece3f
@ -40,13 +40,15 @@
|
|||||||
|
|
||||||
# TODO:3.3: Require CMake 3.12
|
# TODO:3.3: Require CMake 3.12
|
||||||
cmake_minimum_required( VERSION 3.3 FATAL_ERROR )
|
cmake_minimum_required( VERSION 3.3 FATAL_ERROR )
|
||||||
|
|
||||||
|
set( CALAMARES_VERSION 3.2.40 )
|
||||||
|
set( CALAMARES_RELEASE_MODE OFF )
|
||||||
|
|
||||||
project( CALAMARES
|
project( CALAMARES
|
||||||
VERSION 3.2.40
|
VERSION ${CALAMARES_VERSION}
|
||||||
LANGUAGES C CXX
|
LANGUAGES C CXX
|
||||||
)
|
)
|
||||||
|
|
||||||
set( CALAMARES_VERSION_RC 1 ) # Set to 0 during release cycle, 1 during development
|
|
||||||
|
|
||||||
### OPTIONS
|
### OPTIONS
|
||||||
#
|
#
|
||||||
option( INSTALL_CONFIG "Install configuration files" OFF )
|
option( INSTALL_CONFIG "Install configuration files" OFF )
|
||||||
@ -494,11 +496,7 @@ add_feature_info( ExampleDistro ${mksquashfs_FOUND} "Create example-distro targe
|
|||||||
|
|
||||||
### CALAMARES PROPER
|
### CALAMARES PROPER
|
||||||
#
|
#
|
||||||
set( CALAMARES_VERSION ${CALAMARES_VERSION_MAJOR}.${CALAMARES_VERSION_MINOR}.${CALAMARES_VERSION_PATCH} )
|
#
|
||||||
# In rare cases we have hotfix-releases with a tweak
|
|
||||||
if( CALAMARES_VERSION_TWEAK )
|
|
||||||
set( CALAMARES_VERSION "${CALAMARES_VERSION}.${CALAMARES_VERSION_TWEAK}" )
|
|
||||||
endif()
|
|
||||||
set( CALAMARES_VERSION_SHORT "${CALAMARES_VERSION}" )
|
set( CALAMARES_VERSION_SHORT "${CALAMARES_VERSION}" )
|
||||||
|
|
||||||
# Additional info for non-release builds. The "extended" version information
|
# Additional info for non-release builds. The "extended" version information
|
||||||
@ -506,7 +504,7 @@ set( CALAMARES_VERSION_SHORT "${CALAMARES_VERSION}" )
|
|||||||
# by CalamaresVersionX.h, which is included by consumers that need a full
|
# by CalamaresVersionX.h, which is included by consumers that need a full
|
||||||
# version number with all that information; normal consumers can include
|
# version number with all that information; normal consumers can include
|
||||||
# CalamaresVersion.h with more stable numbers.
|
# CalamaresVersion.h with more stable numbers.
|
||||||
if( NOT CALAMARES_VERSION_RC EQUAL 0 AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git/" )
|
if( NOT CALAMARES_RELEASE_MODE AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git/" )
|
||||||
include( CMakeDateStamp )
|
include( CMakeDateStamp )
|
||||||
set( CALAMARES_VERSION_DATE "${CMAKE_DATESTAMP_YEAR}${CMAKE_DATESTAMP_MONTH}${CMAKE_DATESTAMP_DAY}" )
|
set( CALAMARES_VERSION_DATE "${CMAKE_DATESTAMP_YEAR}${CMAKE_DATESTAMP_MONTH}${CMAKE_DATESTAMP_DAY}" )
|
||||||
if( CALAMARES_VERSION_DATE GREATER 0 )
|
if( CALAMARES_VERSION_DATE GREATER 0 )
|
||||||
@ -521,7 +519,7 @@ endif()
|
|||||||
|
|
||||||
# Special target for displaying the version. In RC (might-be-release)
|
# Special target for displaying the version. In RC (might-be-release)
|
||||||
# builds, use the short version (3.x.y), otherwise show the long version.
|
# builds, use the short version (3.x.y), otherwise show the long version.
|
||||||
if ( CALAMARES_VERSION_RC EQUAL 0 )
|
if ( CALAMARES_RELEASE_MODE )
|
||||||
add_custom_target(show-version
|
add_custom_target(show-version
|
||||||
${CMAKE_COMMAND} -E echo CALAMARES_VERSION=${CALAMARES_VERSION_SHORT}
|
${CMAKE_COMMAND} -E echo CALAMARES_VERSION=${CALAMARES_VERSION_SHORT}
|
||||||
USES_TERMINAL
|
USES_TERMINAL
|
||||||
|
@ -27,7 +27,8 @@
|
|||||||
|
|
||||||
## (1) Preparation
|
## (1) Preparation
|
||||||
|
|
||||||
* Drop the RC variable to 0 in `CMakeLists.txt`, *CALAMARES_VERSION_RC*.
|
* Double-check the *CALAMARES_VERSION* value at the top of `CMakeLists.txt`.
|
||||||
|
* Set *CALAMARES_RELEASE_MODE* to `ON` in `CMakeLists.txt`.
|
||||||
* Edit `CHANGES` and set the date of the release.
|
* Edit `CHANGES` and set the date of the release.
|
||||||
* Commit both. This is usually done with commit-message
|
* Commit both. This is usually done with commit-message
|
||||||
*Changes: pre-release housekeeping*.
|
*Changes: pre-release housekeeping*.
|
||||||
@ -78,8 +79,8 @@ Follow the instructions printed by the release script.
|
|||||||
|
|
||||||
## (4) Post-Release
|
## (4) Post-Release
|
||||||
|
|
||||||
* Bump the version number in `CMakeLists.txt` in the `project()` command.
|
* Bump the version number in `CMakeLists.txt` in *CALAMARES_VERSION*.
|
||||||
* Set *CALAMARES_VERSION_RC* back to 1.
|
* Set *CALAMARES_RELEASE_MODE* back to `OFF`.
|
||||||
* Add a placeholder entry for the next release in `CHANGES` with date
|
* Add a placeholder entry for the next release in `CHANGES` with date
|
||||||
text *not released yet*.
|
text *not released yet*.
|
||||||
* Commit and push that, usually with the message
|
* Commit and push that, usually with the message
|
||||||
|
Loading…
Reference in New Issue
Block a user