CMake: repair KDE Frameworks 6 dependencies

Be a little more chatty and look for the correct KDE Frameworks
for consumers of Calamares (e.g. calamares-extensions).
This commit is contained in:
Adriaan de Groot 2024-11-21 22:50:44 +01:00
parent 3614fd003d
commit 6a31e30cbf

View File

@ -49,8 +49,12 @@ endmacro()
set(Calamares_WITH_QT6 @WITH_QT6@) set(Calamares_WITH_QT6 @WITH_QT6@)
if(Calamares_WITH_QT6) if(Calamares_WITH_QT6)
set(qtname "Qt6") set(qtname "Qt6")
set(kfname "kf6")
message(STATUS "Calamares was built with Qt6 and KDE Frameworks 6")
else() else()
set(qtname "Qt5") set(qtname "Qt5")
set(kfname "kf5")
message(STATUS "Calamares was built with Qt5 and KDE Frameworks 5 (legacy)")
endif() endif()
# Qt infrastructure for translations is required # Qt infrastructure for translations is required
@ -59,14 +63,14 @@ accumulate_deps(qt_required Calamares::calamares ${qtname}::)
accumulate_deps(qt_required Calamares::calamaresui ${qtname}::) accumulate_deps(qt_required Calamares::calamaresui ${qtname}::)
find_package(${qtname} CONFIG REQUIRED ${qt_required}) find_package(${qtname} CONFIG REQUIRED ${qt_required})
set(kf5_required "") set(kf_required "")
accumulate_deps(kf5_required Calamares::calamares ${kfname}::) accumulate_deps(kf_required Calamares::calamares ${kfname}::)
accumulate_deps(kf5_required Calamares::calamaresui ${kfname}::) accumulate_deps(kf_required Calamares::calamaresui ${kfname}::)
if(kf5_required) if(kf_required)
find_package(ECM ${ECM_VERSION} NO_MODULE) find_package(ECM ${ECM_VERSION} NO_MODULE)
if( ECM_FOUND ) if( ECM_FOUND )
list(INSERT CMAKE_MODULE_PATH 0 ${ECM_MODULE_PATH}) list(INSERT CMAKE_MODULE_PATH 0 ${ECM_MODULE_PATH})
find_package(${kfname} REQUIRED COMPONENTS ${kf5_required}) find_package(${kfname} REQUIRED COMPONENTS ${kf_required})
endif() endif()
endif() endif()