qt, cpp: Fix versioning in cmake config and header
authorAndre Heinecke <aheinecke@intevation.de>
Wed, 2 Nov 2016 13:43:44 +0000 (14:43 +0100)
committerAndre Heinecke <aheinecke@intevation.de>
Wed, 2 Nov 2016 13:43:44 +0000 (14:43 +0100)
* 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.

configure.ac
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

index 600e8ba..b52f214 100644 (file)
@@ -79,6 +79,10 @@ NEED_LIBASSUAN_VERSION=2.0.2
 PACKAGE=$PACKAGE_NAME
 VERSION=$PACKAGE_VERSION
 
 PACKAGE=$PACKAGE_NAME
 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_MACRO_DIR([m4])
 AC_CONFIG_SRCDIR(src/gpgme.h.in)
 AC_CONFIG_AUX_DIR([build-aux])
 AC_CONFIG_MACRO_DIR([m4])
 AC_CONFIG_SRCDIR(src/gpgme.h.in)
@@ -119,6 +123,9 @@ AC_SUBST(LIBQGPGME_LT_REVISION)
 
 AC_SUBST(PACKAGE)
 AC_SUBST(VERSION)
 
 AC_SUBST(PACKAGE)
 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(VERSION, "$VERSION", [Version of this package])
 VERSION_NUMBER=m4_esyscmd(printf "0x%02x%02x%02x" mym4_version_major \
 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of this package])
 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version of this package])
 VERSION_NUMBER=m4_esyscmd(printf "0x%02x%02x%02x" mym4_version_major \
index 43d6512..259bddd 100644 (file)
@@ -19,7 +19,7 @@
 # 02111-1307, USA
 
 # based on a generated file from cmake.
 # 02111-1307, USA
 
 # 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}" )
   set(PACKAGE_VERSION_COMPATIBLE FALSE)
 
 if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}" )
   set(PACKAGE_VERSION_COMPATIBLE FALSE)
index 3c33a30..9cf6aeb 100644 (file)
 #ifndef GPGMEPP_VERSION_H
 #define GPGMEPP_VERSION_H
 
 #ifndef GPGMEPP_VERSION_H
 #define GPGMEPP_VERSION_H
 
-#define GPGMEPP_VERSION_STRING "@LIBGPGMEPP_LT_CURRENT@.@LIBGPGMEPP_LT_AGE@.@LIBGPGMEPP_LT_REVISION@"
-#define GPGMEPP_VERSION_MAJOR @LIBGPGMEPP_LT_CURRENT@
-#define GPGMEPP_VERSION_MINOR @LIBGPGMEPP_LT_AGE@
-#define GPGMEPP_VERSION_PATCH @LIBGPGMEPP_LT_REVISION@
-#define GPGMEPP_VERSION ((@LIBGPGMEPP_LT_CURRENT@<<16)|(@LIBGPGMEPP_LT_AGE@<<8)|(@LIBGPGMEPP_LT_REVISION@))
-
+#define GPGMEPP_VERSION_STRING "@VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_MICRO@"
+#define GPGMEPP_VERSION_MAJOR @VERSION_MAJOR@
+#define GPGMEPP_VERSION_MINOR @VERSION_MINOR@
+#define GPGMEPP_VERSION_PATCH @VERSION_MICRO@
+#define GPGMEPP_VERSION ((@VERSION_MAJOR@<<16)|(@VERSION_MINOR@<<8)|(@VERSION_MICRO@))
 #endif
 #endif
index 04a12cb..549a536 100644 (file)
@@ -19,7 +19,7 @@
 # 02111-1307, USA
 
 # based on a generated file from cmake.
 # 02111-1307, USA
 
 # 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}" )
   set(PACKAGE_VERSION_COMPATIBLE FALSE)
 
 if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}" )
   set(PACKAGE_VERSION_COMPATIBLE FALSE)
index 9fbe965..5ec59a8 100644 (file)
 #ifndef QGPGME_VERSION_H
 #define QGPGME_VERSION_H
 
 #ifndef QGPGME_VERSION_H
 #define QGPGME_VERSION_H
 
-#define QGPGME_VERSION_STRING "@LIBQGPGME_LT_CURRENT@.@LIBQGPGME_LT_AGE@.@LIBQGPGME_LT_REVISION@"
-#define QGPGME_VERSION_MAJOR @LIBQGPGME_LT_CURRENT@
-#define QGPGME_VERSION_MINOR @LIBQGPGME_LT_AGE@
-#define QGPGME_VERSION_PATCH @LIBQGPGME_LT_REVISION@
-#define QGPGME_VERSION ((@LIBQGPGME_LT_CURRENT@<<16)|(@LIBQGPGME_LT_AGE@<<8)|(@LIBQGPGME_LT_REVISION@))
+#define QGPGME_VERSION_STRING "@VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_MICRO@"
+#define QGPGME_VERSION_MAJOR @VERSION_MAJOR@
+#define QGPGME_VERSION_MINOR @VERSION_MINOR@
+#define QGPGME_VERSION_PATCH @VERSION_MICRO@
+#define QGPGME_VERSION ((@VERSION_MAJOR@<<16)|(@VERSION_MINOR@<<8)|(@VERSION_MICRO@))
 
 #endif
 
 #endif