From 70390097b01e5a3d7ae6f55d84673bb0dc84fb01 Mon Sep 17 00:00:00 2001 From: Levi Neely <141506390+lneely@users.noreply.github.com> Date: Fri, 7 Aug 2026 18:58:42 +0200 Subject: [PATCH] fix KF6 auto-detect on distros without monolithic KF6Config.cmake --- CMakeLists.txt | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 061f318..87465a3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,10 +3,15 @@ project(kde-ollie VERSION 0.1.0 LANGUAGES CXX) option(OLLIE_KF5 "Build against KF5/Qt5 (Plasma 5.27)" OFF) -# Auto-detect: if OLLIE_KF5 not explicitly set, try KF6 first, fall back to KF5 +# Auto-detect: if OLLIE_KF5 not explicitly set, try KF6 first, fall back to KF5. +# Note: Gentoo and some distros don't ship a monolithic KF6Config.cmake; check +# individual components directly instead of find_package(KF6 COMPONENTS ...). if(NOT DEFINED OLLIE_KF5 OR NOT OLLIE_KF5) - find_package(KF6 QUIET COMPONENTS Runner CoreAddons) - if(NOT KF6_FOUND) + find_package(KF6Runner QUIET) + find_package(KF6CoreAddons QUIET) + if(KF6Runner_FOUND AND KF6CoreAddons_FOUND) + set(KF6_FOUND TRUE) + else() message(STATUS "KF6 not found, falling back to KF5") set(OLLIE_KF5 ON) endif()