From 77aa5503af433c929c2101c8769df7921f1d8eca Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Mon, 26 Feb 2024 23:28:48 +0000 Subject: [PATCH] FIXUP: Rework version handling --- CMakeLists.txt | 18 ++++++++++++++---- cmake/bitcoin-config.h.in | 12 ++++++------ cmake/module/GenerateSetupNsi.cmake | 4 ---- 3 files changed, 20 insertions(+), 14 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 98a636bd99f61..3c2bd30244f95 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,16 +17,26 @@ # See: https://cmake.org/cmake/help/latest/manual/cmake-policies.7.html cmake_minimum_required(VERSION 3.16...3.28) +set(PACKAGE_NAME "Bitcoin Core") +set(CLIENT_VERSION_MAJOR 26) +set(CLIENT_VERSION_MINOR 99) +set(CLIENT_VERSION_BUILD 0) +set(CLIENT_VERSION_RC 0) +set(CLIENT_VERSION_IS_RELEASE "false") +set(COPYRIGHT_YEAR "2024") + project(BitcoinCore - VERSION 26.99.0 + VERSION ${CLIENT_VERSION_MAJOR}.${CLIENT_VERSION_MINOR}.${CLIENT_VERSION_BUILD} DESCRIPTION "Bitcoin client software" HOMEPAGE_URL "https://bitcoincore.org/" LANGUAGES CXX ASM ) -set(PACKAGE_NAME "Bitcoin Core") -set(CLIENT_VERSION_IS_RELEASE "false") -set(COPYRIGHT_YEAR "2024") +set(PACKAGE_VERSION ${PROJECT_VERSION}) +if(CLIENT_VERSION_RC GREATER 0) + string(APPEND PACKAGE_VERSION "rc${CLIENT_VERSION_RC}") +endif() + set(COPYRIGHT_HOLDERS "The %s developers") set(COPYRIGHT_HOLDERS_FINAL "The ${PACKAGE_NAME} developers") set(PACKAGE_BUGREPORT "https://github.com/bitcoin/bitcoin/issues") diff --git a/cmake/bitcoin-config.h.in b/cmake/bitcoin-config.h.in index ebbb97562cdb0..73f36b7b4386a 100644 --- a/cmake/bitcoin-config.h.in +++ b/cmake/bitcoin-config.h.in @@ -10,16 +10,16 @@ #cmakedefine CHAR_EQUALS_INT8 1 /* Version Build */ -#define CLIENT_VERSION_BUILD @PROJECT_VERSION_PATCH@ +#define CLIENT_VERSION_BUILD @CLIENT_VERSION_BUILD@ /* Version is release */ #define CLIENT_VERSION_IS_RELEASE @CLIENT_VERSION_IS_RELEASE@ /* Major version */ -#define CLIENT_VERSION_MAJOR @PROJECT_VERSION_MAJOR@ +#define CLIENT_VERSION_MAJOR @CLIENT_VERSION_MAJOR@ /* Minor version */ -#define CLIENT_VERSION_MINOR @PROJECT_VERSION_MINOR@ +#define CLIENT_VERSION_MINOR @CLIENT_VERSION_MINOR@ /* Copyright holder(s) before %s replacement */ #define COPYRIGHT_HOLDERS "@COPYRIGHT_HOLDERS@" @@ -28,7 +28,7 @@ #define COPYRIGHT_HOLDERS_FINAL "@COPYRIGHT_HOLDERS_FINAL@" /* Replacement for %s in copyright holders string */ -#define COPYRIGHT_HOLDERS_SUBSTITUTION "@PROJECT_NAME@" +#define COPYRIGHT_HOLDERS_SUBSTITUTION "@PACKAGE_NAME@" /* Copyright year */ #define COPYRIGHT_YEAR @COPYRIGHT_YEAR@ @@ -191,13 +191,13 @@ #define PACKAGE_BUGREPORT "@PACKAGE_BUGREPORT@" /* Define to the full name of this package. */ -#define PACKAGE_NAME "@PROJECT_NAME@" +#define PACKAGE_NAME "@PACKAGE_NAME@" /* Define to the home page for this package. */ #define PACKAGE_URL "@PROJECT_HOMEPAGE_URL@" /* Define to the version of this package. */ -#define PACKAGE_VERSION "@PROJECT_VERSION@" +#define PACKAGE_VERSION "@PACKAGE_VERSION@" /* Define to 1 if strerror_r returns char *. */ #cmakedefine STRERROR_R_CHAR_P 1 diff --git a/cmake/module/GenerateSetupNsi.cmake b/cmake/module/GenerateSetupNsi.cmake index 7c7457e3609bf..b7ea423611f7f 100644 --- a/cmake/module/GenerateSetupNsi.cmake +++ b/cmake/module/GenerateSetupNsi.cmake @@ -5,10 +5,6 @@ function(generate_setup_nsi) set(abs_top_srcdir ${PROJECT_SOURCE_DIR}) set(abs_top_builddir ${PROJECT_BINARY_DIR}) - set(PACKAGE_VERSION ${PROJECT_VERSION}) - set(CLIENT_VERSION_MAJOR ${PROJECT_VERSION_MAJOR}) - set(CLIENT_VERSION_MINOR ${PROJECT_VERSION_MINOR}) - set(CLIENT_VERSION_BUILD ${PROJECT_VERSION_PATCH}) set(PACKAGE_URL ${PROJECT_HOMEPAGE_URL}) set(PACKAGE_TARNAME "bitcoin") set(BITCOIN_GUI_NAME "bitcoin-qt")