fix KF6 auto-detect on distros without monolithic KF6Config.cmake
This commit is contained in:
parent
a4c6802430
commit
70390097b0
|
|
@ -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()
|
||||
|
|
|
|||
Reference in New Issue