[pim/libkleo] /: Use different SOVERSION for each minor release

Ingo Klöcker <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit a372ef5f7bc1474c7586e0d4bb90de5d100c3ff5 by Ingo Klöcker, on behalf of Ingo Klöcker.
Committed on 23/07/2026 at 15:31.
Pushed by kloecker into branch 'master'.

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.

M  +9    -1    CMakeLists.txt

https://invent.kde.org/pim/libkleo/-/commit/a372ef5f7bc1474c7586e0d4bb90de5d100c3ff5

diff --git a/CMakeLists.txt b/CMakeLists.txt
index aca2f526..63f793fa 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4,6 +4,14 @@ cmake_minimum_required(VERSION 3.29)
 set(PIM_VERSION "6.8.40")
 
 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.26.0")
 
@@ -74,7 +82,7 @@ set_package_properties(Boost PROPERTIES
 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.