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)
|
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)
|
if(NOT DEFINED OLLIE_KF5 OR NOT OLLIE_KF5)
|
||||||
find_package(KF6 QUIET COMPONENTS Runner CoreAddons)
|
find_package(KF6Runner QUIET)
|
||||||
if(NOT KF6_FOUND)
|
find_package(KF6CoreAddons QUIET)
|
||||||
|
if(KF6Runner_FOUND AND KF6CoreAddons_FOUND)
|
||||||
|
set(KF6_FOUND TRUE)
|
||||||
|
else()
|
||||||
message(STATUS "KF6 not found, falling back to KF5")
|
message(STATUS "KF6 not found, falling back to KF5")
|
||||||
set(OLLIE_KF5 ON)
|
set(OLLIE_KF5 ON)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
||||||
Reference in New Issue