[pim/libkleo/gpg4win/gpd-5.2] /: Use different SOVERSION for each minor release

Ingo Klöcker <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 8c8410a2b0c73a9b48039904619d1ee4c96c0611 by Ingo Klöcker, on behalf of Ingo Klöcker.
Committed on 30/07/2026 at 09:35.
Pushed by kloecker into branch 'gpg4win/gpd-5.2'.

Use different SOVERSION for each minor release

We don't guarantee ABI stability between minor releases. Hence we should
bump the SOVERSION with each minor release.

(cherry picked from commit a372ef5f7bc1474c7586e0d4bb90de5d100c3ff5)

M  +9    -1    CMakeLists.txt

https://invent.kde.org/pim/libkleo/-/commit/8c8410a2b0c73a9b48039904619d1ee4c96c0611

diff --git a/CMakeLists.txt b/CMakeLists.txt
index be646551..9a664f90 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4,6 +4,14 @@ cmake_minimum_required(VERSION 3.29)
 set(PIM_VERSION "6.7.46")
 
 project(libkleo VERSION ${PIM_VERSION})
+# use a different SOVERSION for each minor release because we don't guarantee any ABI stability;
+# bump the SOVERSION with the first development version, i.e. major.minor.40
+if(libkleo_VERSION_PATCH VERSION_GREATER_EQUAL "40")
+    math(EXPR minorPlus1 "${libkleo_VERSION_MINOR} + 1")
+    set(soversion ${libkleo_VERSION_MAJOR}.${minorPlus1})
+else()
+    set(soversion ${libkleo_VERSION_MAJOR}.${libkleo_VERSION_MINOR})
+endif()
 
 set(KF_MIN_VERSION "6.22.0")
 
@@ -71,7 +79,7 @@ set_package_properties(Boost PROPERTIES DESCRIPTION "Boost C++ Libraries" URL "h
 ecm_setup_version(PROJECT VARIABLE_PREFIX LIBKLEO
                         VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/libkleo_version.h"
                         PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KPim6LibkleoConfigVersion.cmake"
-                        SOVERSION 6
+                        SOVERSION ${soversion}
 )
 
 ########### Targets ###########
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.