From kde-commits Tue Jun 30 22:56:48 2015 From: Jaroslaw Staniek Date: Tue, 30 Jun 2015 22:56:48 +0000 To: kde-commits Subject: [calligra/frameworks] /: Modernize version macros for the 3.0 series: use 2.99.89 for the 3.0.0 Alph Message-Id: X-MARC-Message: https://marc.info/?l=kde-commits&m=143570502212145 Git commit 1f5e838b7e20ba195a179d885738e617bead258b by Jaroslaw Staniek. Committed on 30/06/2015 at 22:49. Pushed by staniek into branch 'frameworks'. Modernize version macros for the 3.0 series: use 2.99.89 for the 3.0.0 Alpha +No Pre-Alpha anymore, just Alpha, both are the same in fact +2.99.x is the approach of KF5 too +make it easier to bump the version +add more version macros so apps don't have to compute it +GENERIC_CALLIGRA_LIB_VERSION_MAJOR for 3.0 isn't changed: 15 Differential Revision: https://phabricator.kde.org/D126 M +13 -15 CMakeLists.txt M +50 -16 libs/version/calligraversion.h.cmake http://commits.kde.org/calligra/1f5e838b7e20ba195a179d885738e617bead258b diff --git a/CMakeLists.txt b/CMakeLists.txt index 29a0a41..580cfa4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,11 +38,11 @@ endif() = # define common versions of Calligra applications, used to generate callig= raversion.h # update these version for every release: -set(CALLIGRA_VERSION_STRING "3.0 Pre-Alpha") -set(CALLIGRA_VERSION_MAJOR 2) -set(CALLIGRA_STABLE_VERSION_MINOR 9) -set(CALLIGRA_VERSION_RELEASE 89) # 89 for Alpha, increase for next test r= eleases, set 0 for first Stable, etc. -set(CALLIGRA_ALPHA 1) # uncomment only for Pre-Alpha and Alpha +set(CALLIGRA_VERSION_STRING "3.0 Alpha") +set(CALLIGRA_STABLE_VERSION_MAJOR 3) # 3 for 3.x, 4 for 4.x, etc. +set(CALLIGRA_STABLE_VERSION_MINOR 0) # 0 for 3.0, 1 for 3.1, etc. +set(CALLIGRA_VERSION_RELEASE 89) # 89 for Alpha, increase for next tes= t releases, set 0 for first Stable, etc. +set(CALLIGRA_ALPHA 1) # uncomment only for Alpha #set(CALLIGRA_BETA 1) # uncomment only for Beta #set(CALLIGRA_RC 1) # uncomment only for RC set(CALLIGRA_YEAR 2015) # update every year @@ -53,17 +53,15 @@ endif() = message(STATUS "Calligra version: ${CALLIGRA_VERSION_STRING}") = -# define the generic version of the Calligra libraries here -# this makes it easy to advance it when the next Calligra release comes -if(CALLIGRA_VERSION_MAJOR EQUAL 2) - math(EXPR GENERIC_CALLIGRA_LIB_VERSION_MAJOR "${CALLIGRA_STABLE_VERSIO= N_MINOR} + 5") - if(NOT DEFINED CALLIGRA_STABLE) - # bump some more because it is in fact unstable 3.0 so has to be l= arger than for any 2.9.x - math(EXPR GENERIC_CALLIGRA_LIB_VERSION_MAJOR "${GENERIC_CALLIGRA_L= IB_VERSION_MAJOR} + 1") - endif() +# Define the generic version of the Calligra libraries here +# This makes it easy to advance it when the next Calligra release comes. +# 14 was the last GENERIC_CALLIGRA_LIB_VERSION_MAJOR of the previous Calli= gra series +# (2.x) so we're starting with 15 in 3.x series. +if(CALLIGRA_STABLE_VERSION_MAJOR EQUAL 3) + math(EXPR GENERIC_CALLIGRA_LIB_VERSION_MAJOR "${CALLIGRA_STABLE_VERSIO= N_MINOR} + 15") else() - # let's make sure we won't forget to update the "5" - message(FATAL_ERROR "Reminder: please update offset =3D=3D 5 used to c= ompute GENERIC_CALLIGRA_LIB_VERSION_MAJOR to something bigger") + # let's make sure we won't forget to update the "15" + message(FATAL_ERROR "Reminder: please update offset =3D=3D 15 used to = compute GENERIC_CALLIGRA_LIB_VERSION_MAJOR to something bigger") endif() set(GENERIC_CALLIGRA_LIB_VERSION "${GENERIC_CALLIGRA_LIB_VERSION_MAJOR}.0.= 0") set(GENERIC_CALLIGRA_LIB_SOVERSION "${GENERIC_CALLIGRA_LIB_VERSION_MAJOR}") diff --git a/libs/version/calligraversion.h.cmake b/libs/version/calligrave= rsion.h.cmake index c56595c..5f90a5d 100644 --- a/libs/version/calligraversion.h.cmake +++ b/libs/version/calligraversion.h.cmake @@ -2,6 +2,7 @@ Copyright (c) 2003 David Faure Copyright (c) 2003 Lukas Tinkl Copyright (c) 2004 Nicolas Goutte + Copyright (C) 2015 Jaros=C5=82aw Staniek = This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -24,7 +25,7 @@ = #include "koversion_export.h" = -// -- WARNING: do not edit values below, instead edit CALLIGRA_VERSION_*, = etc in /CMakeLists.txt -- +// -- WARNING: do not edit values below, instead edit CALLIGRA_* in /CMake= Lists.txt -- = /** * @def CALLIGRA_VERSION_STRING @@ -39,27 +40,58 @@ * especially for development versions of Calligra. * If you use that macro directly for a file format (e.g. OASIS Open Docume= nt) * or for a protocol (e.g. http) be careful that it is appropriate. -* (Fictional) example: "2.8 Pre-Alpha" +* (Fictional) example: "3.0 Alpha" */ #define CALLIGRA_VERSION_STRING "@CALLIGRA_VERSION_STRING@" = /** + * @def CALLIGRA_STABLE_VERSION_MAJOR + * @ingroup CalligraMacros + * @brief Major version of stable Calligra, at compile time + * CALLIGRA_VERSION_MAJOR is computed based on this value. +*/ +#define CALLIGRA_STABLE_VERSION_MAJOR @CALLIGRA_STABLE_VERSION_MAJOR@ + +/** * @def CALLIGRA_VERSION_MAJOR * @ingroup CalligraMacros * @brief Major version of Calligra, at compile time + * + * Generally it's the same as CALLIGRA_STABLE_VERSION_MAJOR but for unstab= le x.0 + * x is decreased by one, e.g. 3.0 Beta is 2.99. */ -#define CALLIGRA_VERSION_MAJOR @CALLIGRA_VERSION_MAJOR@ +#if !defined CALLIGRA_STABLE && @CALLIGRA_STABLE_VERSION_MINOR@ =3D=3D 0 +# define CALLIGRA_VERSION_MAJOR (CALLIGRA_STABLE_VERSION_MAJOR - 1) +#else +# define CALLIGRA_VERSION_MAJOR CALLIGRA_STABLE_VERSION_MAJOR +#endif = /** * @def CALLIGRA_STABLE_VERSION_MINOR * @ingroup CalligraMacros * @brief Minor version of stable Calligra, at compile time * CALLIGRA_VERSION_MINOR is computed based on this value. - * Unstable versions subtract 1 from this value, e.g. 2.5 Alpha has minor = 4. -*/ + */ #define CALLIGRA_STABLE_VERSION_MINOR @CALLIGRA_STABLE_VERSION_MINOR@ = /** + * @def CALLIGRA_VERSION_MINOR + * @ingroup CalligraMacros + * @brief Minor version of Calligra, at compile time + * + * Generally it's equal to CALLIGRA_STABLE_VERSION_MINOR for stable releas= es, + * equal to 99 for x.0 unstable releases (e.g. it's 3.0 Beta has minor ver= sion 99), + * and equal to CALLIGRA_STABLE_VERSION_MINOR-1 for unstable releases othe= r than x.0. + */ +#ifdef CALLIGRA_STABLE +# define CALLIGRA_VERSION_MINOR CALLIGRA_STABLE_VERSION_MINOR +#elif CALLIGRA_STABLE_VERSION_MINOR =3D=3D 0 +# define CALLIGRA_VERSION_MINOR 99 +#else +# define CALLIGRA_VERSION_MINOR (CALLIGRA_STABLE_VERSION_MINOR - 1) +#endif + +/** * @def CALLIGRA_VERSION_RELEASE * @ingroup CalligraMacros * @brief Release version of Calligra, at compile time. @@ -68,6 +100,19 @@ #define CALLIGRA_VERSION_RELEASE @CALLIGRA_VERSION_RELEASE@ = /** + * @def CALLIGRA_STABLE_VERSION_RELEASE + * @ingroup CalligraMacros + * @brief Release version of Calligra, at compile time. + * + * Equal to CALLIGRA_VERSION_RELEASE for stable releases and 0 for unstabl= e ones. + */ +#ifdef CALLIGRA_STABLE +# define CALLIGRA_STABLE_VERSION_RELEASE 0 +#else +# define CALLIGRA_STABLE_VERSION_RELEASE @CALLIGRA_VERSION_RELEASE@ +#endif + +/** * @def CALLIGRA_ALPHA * @ingroup CalligraMacros * @brief If defined (1..9), indicates at compile time that Calligra is in= alpha stage @@ -96,17 +141,6 @@ #cmakedefine CALLIGRA_STABLE @CALLIGRA_STABLE@ = /** - * @def CALLIGRA_VERSION_MINOR - * @ingroup CalligraMacros - * @brief Minor version of Calligra, at compile time -*/ -#ifdef CALLIGRA_STABLE -# define CALLIGRA_VERSION_MINOR CALLIGRA_STABLE_VERSION_MINOR -#else // Unstable versions subtract 1 from this value, e.g. 2.5 Alpha has = minor 4. -# define CALLIGRA_VERSION_MINOR (CALLIGRA_STABLE_VERSION_MINOR - 1) -#endif - -/** * @ingroup CalligraMacros * @brief Make a number from the major, minor and release number of a Call= igra version *