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@)
if(Calamares_WITH_QT6)
set(qtname "Qt6")
set(kfname "kf6")
message(STATUS "Calamares was built with Qt6 and KDE Frameworks 6")
else()
set(qtname "Qt5")
set(kfname "kf5")
message(STATUS "Calamares was built with Qt5 and KDE Frameworks 5 (legacy)")
endif()
# Qt infrastructure for translations is required
@ -59,14 +63,14 @@ accumulate_deps(qt_required Calamares::calamares ${qtname}::)
accumulate_deps(qt_required Calamares::calamaresui ${qtname}::)
find_package(${qtname} CONFIG REQUIRED ${qt_required})
set(kf5_required "")
accumulate_deps(kf5_required Calamares::calamares ${kfname}::)
accumulate_deps(kf5_required Calamares::calamaresui ${kfname}::)
if(kf5_required)
set(kf_required "")
accumulate_deps(kf_required Calamares::calamares ${kfname}::)
accumulate_deps(kf_required Calamares::calamaresui ${kfname}::)
if(kf_required)
find_package(ECM ${ECM_VERSION} NO_MODULE)
if( ECM_FOUND )
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()