[utilities/skanpage/release/26.08] /: Be a tiny bit more lenient with KSaneCore versions

Heiko Becker <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 7439d1dae94e61da293564738ae1734155b08a41 by Heiko Becker.
Committed on 14/08/2026 at 05:44.
Pushed by heikobecker into branch 'release/26.08'.

Be a tiny bit more lenient with KSaneCore versions

The code comment also contains the motivation, but I add here that
it's an issue with CI I ran into when updating Gear versions after [1].
There was no longer a build of ksanecore with the new version and thus
skanpage failed to build.

[1] https://invent.kde.org/sysadmin/release-tools/-/merge_requests/73

(cherry picked from commit 1b5c6ab1b70d61b27ea5c273aef9812383f4210f)

M  +8    -1    CMakeLists.txt

https://invent.kde.org/utilities/skanpage/-/commit/7439d1dae94e61da293564738ae1734155b08a41

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5a8e5ec..54d938d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -58,7 +58,14 @@ ecm_set_disabled_deprecation_versions(QT 6.9.0
      KF 6.18.0
 )
 
-find_package(KSaneCore6 "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_VERSION_MINOR}" REQUIRED)
+# The intention here is to depend on a release from at least the same release
+# branch and to accomodate the jump from a RC version to .0 (eg. 26.07.90 to
+# 26.08.0), where we shouldn't really add breaking changes anyway.
+math(EXPR KSANECORE_RELEASE_BRANCH_VERSION "${RELEASE_SERVICE_VERSION_MINOR} - (${RELEASE_SERVICE_VERSION_MINOR} -3) % 4")
+if(KSANECORE_RELEASE_BRANCH_VERSION LESS "10")
+    string(PREPEND KSANECORE_RELEASE_BRANCH_VERSION "0") # pad with 0
+endif()
+find_package(KSaneCore6 "${RELEASE_SERVICE_VERSION_MAJOR}.${KSANECORE_RELEASE_BRANCH_VERSION}" REQUIRED)
 
 find_package(KQuickImageEditor REQUIRED)
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.