# Script to build KF5 Frameworks. # # Copyright (c) 2015-2026 by Gilles Caulier # # Redistribution and use is allowed according to the terms of the BSD license. # For details see the accompanying COPYING-CMAKE-SCRIPTS file. # set(EXTPREFIX_frameworks "${EXTPREFIX}") function(InstallKF6Component name version argoptions patch) if(${name} STREQUAL "libksane") set(giturl "https://invent.kde.org/graphics/${name}.git") elseif(${name} STREQUAL "ksanecore") set(giturl "https://invent.kde.org/libraries/${name}.git") elseif(${name} STREQUAL "qca") set(giturl "https://invent.kde.org/libraries/${name}.git") elseif(${name} STREQUAL "phonon") set(giturl "https://invent.kde.org/libraries/${name}.git") elseif(${name} STREQUAL "plasma-wayland-protocols") set(giturl "https://invent.kde.org/libraries/${name}.git") elseif(${name} STREQUAL "breeze") set(giturl "https://invent.kde.org/plasma/${name}.git") else() set(giturl "https://invent.kde.org/frameworks/${name}.git") endif() message(STATUS "--------------------------------") message(STATUS "KDE component : ${name}") message(STATUS "Component version: ${version}") message(STATUS "Component Git Url: ${giturl}") message(STATUS "Configure options: ${argoptions}") message(STATUS "Patch to apply : ${patch}") if(APPLE) if(NOT "${patch}" STREQUAL "") set(patch "${PATCH_COMMAND};-p1;-i;${CMAKE_CURRENT_SOURCE_DIR}/${patch};&&") endif() ExternalProject_Add(ext_${name} DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR} GIT_REPOSITORY ${giturl} GIT_TAG ${version} PATCH_COMMAND ${patch} cp ${CMAKE_CURRENT_SOURCE_DIR}/../../${DK_APPLE_PACKAGE_MANAGER}/fixbundledatapath.sh /. && /fixbundledatapath.sh INSTALL_DIR ${EXTPREFIX_frameworks} CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTPREFIX_frameworks} -DCMAKE_BUILD_TYPE=${GLOBAL_BUILD_TYPE} ${GLOBAL_PROFILE} -DCMAKE_SYSTEM_PREFIX_PATH=${EXTPREFIX} -DBUILD_TESTING=OFF "${argoptions}" -Wno-dev UPDATE_COMMAND "" ALWAYS 0 ) else() if(NOT "${patch}" STREQUAL "") set(patch "${PATCH_COMMAND};-p1;-i;${CMAKE_CURRENT_SOURCE_DIR}/${patch}") endif() ExternalProject_Add(ext_${name} DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR} GIT_REPOSITORY ${giturl} GIT_TAG ${version} PATCH_COMMAND ${patch} INSTALL_DIR ${EXTPREFIX_frameworks} CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTPREFIX_frameworks} -DCMAKE_BUILD_TYPE=${GLOBAL_BUILD_TYPE} ${GLOBAL_PROFILE} -DCMAKE_SYSTEM_PREFIX_PATH=${EXTPREFIX} -DBUILD_TESTING=OFF "${argoptions}" -Wno-dev UPDATE_COMMAND "" ALWAYS 0 ) endif() endfunction() if(MSVC) # Windows # All is currently broken about the generation and resource icons. # For the moment, We uses a RCC icon sets pre-compiled under Linux. set(BreezeIconsOptions -DBINARY_ICONS_RESOURCE=OFF -DSKIP_INSTALL_ICONS=OFF -DWITH_ICON_GENERATION=OFF) elseif(APPLE) # macOS # Python3 lxml module detection fail under macOS with Macports even if right Python3 version is selected. # Sounds like a python3 path problem not propagated in cmake scripts to run the generation icons python3 script. # After investiguations, the macOS python3 interpreter is used and this one do not provides the lxml module. set(BreezeIconsOptions -DBINARY_ICONS_RESOURCE=ON -DWITH_ICON_GENERATION=OFF) else() # Linux # All is suitable here. set(BreezeIconsOptions -DBINARY_ICONS_RESOURCE=ON) endif() set(MarbleQtOnlyOptions -DWITH_DESIGNER_PLUGIN=OFF -DBUILD_MARBLE_TESTS=OFF -DBUILD_MARBLE_TOOLS=OFF -DBUILD_MARBLE_EXAMPLES=OFF -DBUILD_MARBLE_APPS=OFF -DBUILD_WITH_DBUS=OFF -DQTONLY=ON -DBUILD_TESTING=OFF) set(BreezeOptions -DBUILD_QT6=ON -DBUILD_QT5=OFF -DWITH_DECORATIONS=OFF -DWITH_WALLPAPERS=OFF -DBUILD_TESTING=OFF) set(Qt6CommonOptions -DQT_MAJOR_VERSION=6 -DBUILD_WITH_QT6=ON -DBUILD_PYTHON_BINDINGS=OFF) InstallKF6Component(extra-cmake-modules ${KDE_VERSION} "${Qt6CommonOptions};-DBUILD_DOC=OFF" "") InstallKF6Component(plasma-wayland-protocols v1.20.0 "${Qt6CommonOptions}" "wayland-proto-ecm-version.patch") InstallKF6Component(kconfig ${KDE_VERSION} "${Qt6CommonOptions};-DKCONFIG_USE_QML=OFF" "") InstallKF6Component(breeze-icons ${KDE_VERSION} "${Qt6CommonOptions};${BreezeIconsOptions}" "breeze-icons-dropsvg.patch") InstallKF6Component(solid ${KDE_VERSION} "${Qt6CommonOptions}" "solid-iokit-fixes.patch") InstallKF6Component(kcoreaddons ${KDE_VERSION} "${Qt6CommonOptions};-DKCOREADDONS_USE_QML=OFF" "") InstallKF6Component(threadweaver ${KDE_VERSION} "${Qt6CommonOptions}" "") InstallKF6Component(kwindowsystem ${KDE_VERSION} "${Qt6CommonOptions};-DKWINDOWSYSTEM_WAYLAND=OFF" "") InstallKF6Component(karchive ${KDE_VERSION} "${Qt6CommonOptions};-DWITH_LIBZSTD=OFF;-DWITH_BZIP2=OFF" "") InstallKF6Component(kdbusaddons ${KDE_VERSION} "${Qt6CommonOptions}" "") InstallKF6Component(ki18n ${KDE_VERSION} "${Qt6CommonOptions}" "ki18n-disable-isocodes.patch") InstallKF6Component(kcrash ${KDE_VERSION} "${Qt6CommonOptions}" "") InstallKF6Component(kcodecs ${KDE_VERSION} "${Qt6CommonOptions}" "") InstallKF6Component(kauth ${KDE_VERSION} "${Qt6CommonOptions}" "") InstallKF6Component(kguiaddons ${KDE_VERSION} "${Qt6CommonOptions};-DWITH_WAYLAND=OFF" "") InstallKF6Component(kwidgetsaddons ${KDE_VERSION} "${Qt6CommonOptions}" "") InstallKF6Component(kitemviews ${KDE_VERSION} "${Qt6CommonOptions}" "") InstallKF6Component(kcompletion ${KDE_VERSION} "${Qt6CommonOptions}" "") InstallKF6Component(kcolorscheme ${KDE_VERSION} "${Qt6CommonOptions}" "") InstallKF6Component(kconfigwidgets ${KDE_VERSION} "${Qt6CommonOptions}" "") InstallKF6Component(kiconthemes ${KDE_VERSION} "${Qt6CommonOptions};-DKICONTHEMES_USE_QTQUICK=OFF" "") InstallKF6Component(kservice ${KDE_VERSION} "${Qt6CommonOptions}" "") InstallKF6Component(kglobalaccel ${KDE_VERSION} "${Qt6CommonOptions}" "") InstallKF6Component(kcalendarcore ${KDE_VERSION} "${Qt6CommonOptions}" "") InstallKF6Component(kxmlgui ${KDE_VERSION} "${Qt6CommonOptions}" "") InstallKF6Component(kbookmarks ${KDE_VERSION} "${Qt6CommonOptions}" "") InstallKF6Component(kimageformats ${KDE_VERSION} "${Qt6CommonOptions}" "") InstallKF6Component(knotifyconfig ${KDE_VERSION} "${Qt6CommonOptions}" "") InstallKF6Component(knotifications ${KDE_VERSION} "${Qt6CommonOptions}" "") InstallKF6Component(kjobwidgets ${KDE_VERSION} "${Qt6CommonOptions}" "") InstallKF6Component(sonnet ${KDE_VERSION} "${Qt6CommonOptions};-DSONNET_USE_QML=OFF" "sonnet-hunspell-version.patch") InstallKF6Component(ktextwidgets ${KDE_VERSION} "${Qt6CommonOptions};-DWITH_TEXT_TO_SPEECH=OFF" "") InstallKF6Component(kio ${KDE_VERSION} "${Qt6CommonOptions};-DWITH_WAYLAND=OFF;KIOCORE_ONLY=ON" "kio-drop-deps.patch") InstallKF6Component(kinit ${KDE_VERSION} "${Qt6CommonOptions}" "") InstallKF6Component(kdoctools ${KDE_VERSION} "${Qt6CommonOptions}" "") InstallKF6Component(phonon ${KDE_VERSION} "${Qt6CommonOptions};-DPHONON_BUILD_QT5=OFF" "") InstallKF6Component(ksanecore ${KA_VERSION} "${Qt6CommonOptions};-DQT_MAJOR_VERSION=6" "") InstallKF6Component(libksane ${KA_VERSION} "${Qt6CommonOptions};-DQT_MAJOR_VERSION=6" "") InstallKF6Component(kfilemetadata ${KDE_VERSION} "${Qt6CommonOptions}" "") InstallKF6Component(qca v2.3.10 "${Qt6CommonOptions}" "") InstallKF6Component(kwallet ${KDE_VERSION} "${Qt6CommonOptions};-DBUILD_KSECRETD=OFF;-DBUILD_KWALLETD=OFF;-DBUILD_KWALLET_QUERY=OFF" "") InstallKF6Component(kpackage ${KDE_VERSION} "${Qt6CommonOptions}" "") InstallKF6Component(attica ${KDE_VERSION} "${Qt6CommonOptions}" "") InstallKF6Component(knewstuff ${KDE_VERSION} "${Qt6CommonOptions}" "") InstallKF6Component(kitemmodels ${KDE_VERSION} "${Qt6CommonOptions}" "kitemmodels-drop-qml.patch") InstallKF6Component(kparts ${KDE_VERSION} "${Qt6CommonOptions}" "") InstallKF6Component(krunner ${KDE_VERSION} "${Qt6CommonOptions}" "") InstallKF6Component(breeze ${KP_VERSION} "${Qt6CommonOptions};${BreezeOptions}" "breeze-common-rules.patch")