qt, cpp: Fix versioning in cmake config and header

* configure.ac (VERSION_MAJOR, VERSION_MINOR, VERSION_MICRO): New
subst variables for the version header.
* lang/cpp/src/GpgmeppConfigVersion.cmake.in,
lang/cpp/src/gpgmepp_version.h.in,
lang/qt/src/QGpgmeConfigVersion.cmake.in,
lang/qt/src/qgpgme_version.h.in: Use new variables.

--
Using the LT_* variables was just wrong. Reporting the
package version also makes more sense then the library version.
Having different versions might make ABI breaks more visible
by increasing the major version number, but to have different
versions in the same package is too confusing imo and gpgme
uses a versioning that is unrelated to the library version number.
This commit is contained in:
Andre Heinecke 2016-11-02 14:43:44 +01:00
parent b5c4d56cfd
commit bf9aa0ccf7
5 changed files with 19 additions and 13 deletions

View File

@ -79,6 +79,10 @@ NEED_LIBASSUAN_VERSION=2.0.2
PACKAGE=$PACKAGE_NAME PACKAGE=$PACKAGE_NAME
VERSION=$PACKAGE_VERSION VERSION=$PACKAGE_VERSION
VERSION_MAJOR=mym4_version_major
VERSION_MINOR=mym4_version_minor
VERSION_MICRO=mym4_version_micro
AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_SRCDIR(src/gpgme.h.in) AC_CONFIG_SRCDIR(src/gpgme.h.in)
@ -119,6 +123,9 @@ AC_SUBST(LIBQGPGME_LT_REVISION)
AC_SUBST(PACKAGE) AC_SUBST(PACKAGE)
AC_SUBST(VERSION) AC_SUBST(VERSION)
AC_SUBST(VERSION_MAJOR)
AC_SUBST(VERSION_MINOR)
AC_SUBST(VERSION_MICRO)
AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of this package]) AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of this package])
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version of this package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version of this package])
VERSION_NUMBER=m4_esyscmd(printf "0x%02x%02x%02x" mym4_version_major \ VERSION_NUMBER=m4_esyscmd(printf "0x%02x%02x%02x" mym4_version_major \

View File

@ -19,7 +19,7 @@
# 02111-1307, USA # 02111-1307, USA
# based on a generated file from cmake. # based on a generated file from cmake.
set(PACKAGE_VERSION "@LIBGPGMEPP_LT_CURRENT@.@LIBGPGMEPP_LT_AGE@.@LIBGPGMEPP_LT_REVISION@.@BUILD_REVISION@") set(PACKAGE_VERSION "@VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_MICRO@")
if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}" ) if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}" )
set(PACKAGE_VERSION_COMPATIBLE FALSE) set(PACKAGE_VERSION_COMPATIBLE FALSE)

View File

@ -23,10 +23,9 @@
#ifndef GPGMEPP_VERSION_H #ifndef GPGMEPP_VERSION_H
#define GPGMEPP_VERSION_H #define GPGMEPP_VERSION_H
#define GPGMEPP_VERSION_STRING "@LIBGPGMEPP_LT_CURRENT@.@LIBGPGMEPP_LT_AGE@.@LIBGPGMEPP_LT_REVISION@" #define GPGMEPP_VERSION_STRING "@VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_MICRO@"
#define GPGMEPP_VERSION_MAJOR @LIBGPGMEPP_LT_CURRENT@ #define GPGMEPP_VERSION_MAJOR @VERSION_MAJOR@
#define GPGMEPP_VERSION_MINOR @LIBGPGMEPP_LT_AGE@ #define GPGMEPP_VERSION_MINOR @VERSION_MINOR@
#define GPGMEPP_VERSION_PATCH @LIBGPGMEPP_LT_REVISION@ #define GPGMEPP_VERSION_PATCH @VERSION_MICRO@
#define GPGMEPP_VERSION ((@LIBGPGMEPP_LT_CURRENT@<<16)|(@LIBGPGMEPP_LT_AGE@<<8)|(@LIBGPGMEPP_LT_REVISION@)) #define GPGMEPP_VERSION ((@VERSION_MAJOR@<<16)|(@VERSION_MINOR@<<8)|(@VERSION_MICRO@))
#endif #endif

View File

@ -19,7 +19,7 @@
# 02111-1307, USA # 02111-1307, USA
# based on a generated file from cmake. # based on a generated file from cmake.
set(PACKAGE_VERSION "@LIBQGPGME_LT_CURRENT@.@LIBQGPGME_LT_AGE@.@LIBQGPGME_LT_REVISION@.@BUILD_REVISION@") set(PACKAGE_VERSION "@VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_MICRO@")
if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}" ) if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}" )
set(PACKAGE_VERSION_COMPATIBLE FALSE) set(PACKAGE_VERSION_COMPATIBLE FALSE)

View File

@ -23,10 +23,10 @@
#ifndef QGPGME_VERSION_H #ifndef QGPGME_VERSION_H
#define QGPGME_VERSION_H #define QGPGME_VERSION_H
#define QGPGME_VERSION_STRING "@LIBQGPGME_LT_CURRENT@.@LIBQGPGME_LT_AGE@.@LIBQGPGME_LT_REVISION@" #define QGPGME_VERSION_STRING "@VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_MICRO@"
#define QGPGME_VERSION_MAJOR @LIBQGPGME_LT_CURRENT@ #define QGPGME_VERSION_MAJOR @VERSION_MAJOR@
#define QGPGME_VERSION_MINOR @LIBQGPGME_LT_AGE@ #define QGPGME_VERSION_MINOR @VERSION_MINOR@
#define QGPGME_VERSION_PATCH @LIBQGPGME_LT_REVISION@ #define QGPGME_VERSION_PATCH @VERSION_MICRO@
#define QGPGME_VERSION ((@LIBQGPGME_LT_CURRENT@<<16)|(@LIBQGPGME_LT_AGE@<<8)|(@LIBQGPGME_LT_REVISION@)) #define QGPGME_VERSION ((@VERSION_MAJOR@<<16)|(@VERSION_MINOR@<<8)|(@VERSION_MICRO@))
#endif #endif