diff options
author | Davide Beatrici <git@davidebeatrici.dev> | 2021-01-06 21:42:48 +0300 |
---|---|---|
committer | Davide Beatrici <git@davidebeatrici.dev> | 2021-01-06 21:42:48 +0300 |
commit | 27471118b58e281d305cc95eda8a262dbbd19bd5 (patch) | |
tree | 8ef1dbe7b87662b7c947564027e0a1455b825b67 /CMakeLists.txt | |
parent | fe086b41d83d6f488b5b91167c806a87094e32c0 (diff) |
BUILD(versioning): Make use of the 4th part (build/tweak) of the version
The build number can be specified through the new "BUILD_NUMBER" variable.
This change is very important on Windows, for two reasons:
- It allows to easily identify binaries simply by looking at their version.
More specifically, we can guess what build they're part of.
- Right now snapshots can not be updated without uninstalling first, because the version is the same (i.e. 1.4.0).
By increasing the 4th digit of the version for every build we can solve the issue.
This commit also takes care of renaming a few variables so that they're consistent and also clearer.
For example, "version" is now "RELEASE_ID".
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index a1b33b29e..b5769c668 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,15 +8,22 @@ cmake_minimum_required(VERSION 3.15) cmake_policy(SET CMP0079 NEW) cmake_policy(SET CMP0091 NEW) -set(version "1.4.0" CACHE STRING "Project version") +set(BUILD_NUMBER CACHE STRING "The build number of the current build. Will be used in Mumble's version to make sure newer builds upgrade older installations properly.") +set(RELEASE_ID CACHE STRING "The ID of the current release (used for representation in the UI and the updater)") -string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]" version_short ${version}) +if ("${BUILD_NUMBER}" STREQUAL "") + if(packaging) + message(FATAL_ERROR "Tried to create a Mumble package, without specifying BUILD_NUMBER!") + else() + set(BUILD_NUMBER "0") + endif() +endif() # Get compilation year string(TIMESTAMP MUMBLE_BUILD_YEAR "%Y") project(Mumble - VERSION ${version_short} + VERSION "1.4.0.${BUILD_NUMBER}" DESCRIPTION "Open source, low-latency, high quality voice chat." HOMEPAGE_URL "https://www.mumble.info" LANGUAGES "C" "CXX" @@ -69,10 +76,11 @@ else() endif() message(STATUS "##################################################") -message(STATUS "Mumble version: ${version}") -message(STATUS "Architecture: ${ARCH}") +message(STATUS "Mumble release ID: ${RELEASE_ID}") +message(STATUS "Mumble version: ${PROJECT_VERSION}") +message(STATUS "Architecture: ${ARCH}") if(NOT IS_MULTI_CONFIG) - message(STATUS "Build type: ${CMAKE_BUILD_TYPE}") + message(STATUS "Build type: ${CMAKE_BUILD_TYPE}") else() message(STATUS "Using multi-config generator that will determine build type on-the-fly") endif() |