Warning, /plasma/plasma-desktop/CMakeLists.txt is written in an unsupported language. File is not indexed.

0001 cmake_minimum_required(VERSION 3.16)
0002 
0003 project(plasma-desktop)
0004 
0005 set(PROJECT_VERSION "6.0.80")
0006 set(PROJECT_VERSION_MAJOR 6)
0007 
0008 set(PROJECT_DEP_VERSION "6.0.80")
0009 set(QT_MIN_VERSION "6.6.0")
0010 set(KF6_MIN_VERSION "5.240.0")
0011 set(KDE_COMPILERSETTINGS_LEVEL "5.85")
0012 set(ACCOUNTSQT_DEP_VERSION "1.13")
0013 
0014 set(CMAKE_CXX_STANDARD 20)
0015 set(CMAKE_CXX_STANDARD_REQUIRED ON)
0016 
0017 find_package(ECM ${KF6_MIN_VERSION} REQUIRED NO_MODULE)
0018 set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules)
0019 
0020 include(KDEInstallDirs)
0021 include(KDECMakeSettings)
0022 include(KDECompilerSettings NO_POLICY_SCOPE)
0023 include(ECMFindQmlModule)
0024 include(ECMGenerateExportHeader)
0025 include(ECMInstallIcons)
0026 include(ECMMarkAsTest)
0027 include(ECMMarkNonGuiExecutable)
0028 include(ECMOptionalAddSubdirectory)
0029 include(ECMQtDeclareLoggingCategory)
0030 include(ECMSetupVersion)
0031 include(FeatureSummary)
0032 include(CheckIncludeFiles)
0033 include(KDEClangFormat)
0034 include(KDEGitCommitHooks)
0035 include(ECMQmlModule)
0036 
0037 option(BUILD_KCM_MOUSE_KWIN_WAYLAND "Build the Mouse KCM's KWin+Wayland backend" ON)
0038 option(BUILD_KCM_MOUSE_X11 "Build the Mouse KCM's X11 backend" ON)
0039 option(BUILD_KCM_TOUCHPAD_KWIN_WAYLAND "Build the Touchpad KCM's KWin+Wayland backend" ON)
0040 option(BUILD_KCM_TOUCHPAD_X11 "Build the Touchpad KCM's X11 backend" ON)
0041 
0042 find_package(Qt6 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS
0043     Quick
0044     QuickWidgets
0045     DBus
0046     Widgets
0047     Svg
0048     Concurrent
0049     Core5Compat
0050     Sql # kcms/activities
0051 )
0052 find_package(Qt6 ${QT_MIN_VERSION} CONFIG OPTIONAL_COMPONENTS WaylandClient)
0053 
0054 find_package(KF6 ${KF6_MIN_VERSION} REQUIRED COMPONENTS
0055     Auth
0056     Crash
0057     Config
0058     DocTools
0059     I18n
0060     KCMUtils
0061     NewStuff
0062     KIO
0063     Notifications
0064     NotifyConfig
0065     Attica
0066     Runner
0067     GlobalAccel
0068     CoreAddons # KSharedDataCache required by KImageCache, KStringHandler required by FolderModel
0069     GuiAddons # KImageCache
0070     DBusAddons
0071     Config
0072     WidgetsAddons
0073     Codecs
0074     Sonnet
0075     Package
0076     IconThemes
0077     XmlGui
0078     Svg
0079 )
0080 
0081 find_package(Plasma5Support ${PROJECT_DEP_VERSION} REQUIRED)
0082 find_package(Plasma ${PROJECT_DEP_VERSION} REQUIRED)
0083 find_package(PlasmaQuick ${PROJECT_DEP_VERSION} REQUIRED)
0084 find_package(PlasmaActivities ${PROJECT_DEP_VERSION} REQUIRED)
0085 find_package(PlasmaActivitiesStats ${PROJECT_DEP_VERSION} REQUIRED)
0086 
0087 if(BUILD_TESTING)
0088     find_package(Qt6Test ${QT_MIN_VERSION} CONFIG REQUIRED)
0089     include(ECMAddTests)
0090 endif()
0091 
0092 find_package(AccountsQt6 ${ACCOUNTSQT_DEP_VERSION} CONFIG)
0093 
0094 set_package_properties(AccountsQt6 PROPERTIES
0095     DESCRIPTION "Accounts management library for Qt applications"
0096     URL "https://gitlab.com/accounts-sso/libaccounts-qt"
0097     PURPOSE "Required for building the OpenDesktop integration plugin"
0098     TYPE OPTIONAL
0099 )
0100 
0101 find_package(KAccounts6 20.04)
0102 set_package_properties(KAccounts6 PROPERTIES
0103     DESCRIPTION "Accounts management library for KDE applications"
0104     PURPOSE "Required for building the OpenDesktop integration plugin"
0105     TYPE OPTIONAL
0106 )
0107 
0108 
0109 find_package(PkgConfig REQUIRED)
0110 pkg_check_modules(SignOnOAuth2 IMPORTED_TARGET signon-oauth2plugin)
0111 set_package_properties(signon-oauth2plugin PROPERTIES
0112     DESCRIPTION "Plugin for SignOnQt6 which handles OAuth and OAuth2 logins"
0113     URL "https://gitlab.com/accounts-sso/signon-plugin-oauth2"
0114     PURPOSE "Required for running the OpenDesktop integration plugin"
0115     TYPE RUNTIME
0116 )
0117 
0118 find_package(KF6Kirigami2 ${KF6_MIN_VERSION} CONFIG)
0119 set_package_properties(KF6Kirigami2 PROPERTIES
0120     DESCRIPTION "A QtQuick based components set"
0121     PURPOSE "Required at runtime by many KCMs"
0122     TYPE RUNTIME
0123 )
0124 
0125 
0126 find_package(KF6KirigamiAddons2 0.10.0 CONFIG)
0127 set_package_properties(KF6KirigamiAddons2 PROPERTIES
0128     DESCRIPTION "Extra controls for Kirigami applications"
0129     PURPOSE "Required at runtime for Kickoff"
0130     TYPE RUNTIME
0131 )
0132 
0133 find_package(KF6QQC2DesktopStyle ${KF6_MIN_VERSION} CONFIG)
0134 set_package_properties(KF6QQC2DesktopStyle PROPERTIES
0135     DESCRIPTION "QtQuickControls 2 style that uses QWidget's QStyle for painting"
0136     PURPOSE "Required at runtime by many KCMs"
0137     TYPE RUNTIME
0138 )
0139 
0140 find_package(WaylandProtocols 1.25)
0141 set_package_properties(WaylandProtocols PROPERTIES
0142     TYPE REQUIRED
0143     PURPOSE "Collection of Wayland protocols that add functionality not available in the Wayland core protocol"
0144     URL "https://gitlab.freedesktop.org/wayland/wayland-protocols/"
0145 )
0146 find_package(Wayland 1.2)
0147 set_package_properties(Wayland PROPERTIES
0148     TYPE REQUIRED
0149     PURPOSE "Required for building Tablet input KCM"
0150 )
0151 
0152 find_package(SDL2 2.0.16)
0153 set_package_properties(SDL2 PROPERTIES
0154         TYPE OPTIONAL
0155         PURPOSE "Required for building Game Controller KCM"
0156 )
0157 
0158 find_package(LibKWorkspace ${PROJECT_DEP_VERSION} CONFIG REQUIRED)
0159 find_package(LibNotificationManager ${PROJECT_DEP_VERSION} CONFIG REQUIRED)
0160 find_package(LibTaskManager ${PROJECT_DEP_VERSION} CONFIG REQUIRED)
0161 find_package(LibColorCorrect ${PROJECT_DEP_VERSION} CONFIG REQUIRED)
0162 find_package(KWinDBusInterface CONFIG REQUIRED)
0163 find_package(ScreenSaverDBusInterface CONFIG REQUIRED)
0164 find_package(KRunnerAppDBusInterface CONFIG REQUIRED)
0165 find_package(KSMServerDBusInterface CONFIG REQUIRED)
0166 find_package(KF6ItemModels CONFIG REQUIRED)
0167 find_package(KSysGuard CONFIG REQUIRED)
0168 find_package(KF6KDED CONFIG REQUIRED)
0169 
0170 find_package(KF6Baloo ${KF6_MIN_VERSION})
0171 set_package_properties(KF6Baloo PROPERTIES
0172     DESCRIPTION "File Searching"
0173     PURPOSE "Needed to build the File Search KCM"
0174     TYPE RECOMMENDED
0175 )
0176 
0177 find_package(X11)
0178 set_package_properties(X11 PROPERTIES
0179     DESCRIPTION "X11 libraries"
0180     URL "https://www.x.org"
0181     PURPOSE "Required for building the X11 based workspace"
0182     TYPE REQUIRED
0183 )
0184 
0185 if(X11_FOUND)
0186   set(HAVE_X11 1)
0187 endif()
0188 
0189 find_package(Canberra)
0190 set_package_properties(Canberra PROPERTIES
0191     PURPOSE "Support audible bell in kaccess"
0192     TYPE REQUIRED)
0193 
0194 find_package(UDev)
0195 set_package_properties(UDev PROPERTIES
0196     DESCRIPTION "API for enumerating and introspecting local devices (part of systemd)"
0197     URL "https://www.freedesktop.org/wiki/Software/systemd/"
0198     PURPOSE "Required for device discovery in keyboard daemon"
0199     TYPE OPTIONAL
0200 )
0201 
0202 find_package(XCB
0203     REQUIRED COMPONENTS
0204         XCB SHM IMAGE
0205     OPTIONAL_COMPONENTS
0206         XKB XINPUT ATOM RECORD
0207 )
0208 
0209 if (BUILD_KCM_TOUCHPAD_X11)
0210     find_package(X11_XCB)
0211     set_package_properties(X11_XCB PROPERTIES
0212         PURPOSE "Required for touchpad KCM (X11 backend) when option BUILD_KCM_TOUCHPAD_X11=ON"
0213         TYPE REQUIRED
0214     )
0215 endif()
0216 
0217 
0218 find_package(ICU COMPONENTS i18n uc)
0219 set_package_properties(ICU PROPERTIES
0220     PURPOSE "Retrieving timezone info"
0221     TYPE REQUIRED
0222 )
0223 
0224 set_package_properties(XCB PROPERTIES TYPE REQUIRED)
0225 add_feature_info("XCB-XKB" XCB_XKB_FOUND "Required for building kcm/keyboard")
0226 add_feature_info("libxft" X11_Xft_FOUND "X FreeType interface library required for font installation")
0227 
0228 pkg_check_modules(XORGLIBINPUT xorg-libinput IMPORTED_TARGET)
0229 pkg_check_modules(EVDEV xorg-evdev>=2.8.99.1 IMPORTED_TARGET)
0230 pkg_check_modules(XORGSERVER xorg-server IMPORTED_TARGET)
0231 
0232 ecm_find_qmlmodule(org.kde.pipewire 0.1)
0233 
0234 if(XORGLIBINPUT_FOUND)
0235   set(HAVE_XORGLIBINPUT 1)
0236 endif()
0237 
0238 include(ConfigureChecks.cmake)
0239 
0240 find_package(PackageKitQt6)
0241 set_package_properties(PackageKitQt6 PROPERTIES
0242     DESCRIPTION "Software Manager integration"
0243     PURPOSE "Used in the KRunner plugin installer"
0244     TYPE OPTIONAL
0245 )
0246 
0247 if(PackageKitQt6_FOUND)
0248     set(HAVE_PACKAGEKIT TRUE)
0249 endif()
0250 
0251 find_package(GLIB2)
0252 set_package_properties(GLIB2 PROPERTIES
0253     PURPOSE "Required for building kimpanel"
0254     TYPE OPTIONAL
0255 )
0256 
0257 # For kimpanel
0258 pkg_check_modules(IBUS "ibus-1.0>=1.5.0" IMPORTED_TARGET)
0259 pkg_check_modules(GOBJECT gobject-2.0 IMPORTED_TARGET)
0260 pkg_check_modules(SCIM scim IMPORTED_TARGET)
0261 
0262 ecm_setup_version(${PROJECT_VERSION} VARIABLE_PREFIX PLASMA VERSION_HEADER plasma_version.h)
0263 
0264 include_directories("${CMAKE_CURRENT_BINARY_DIR}")
0265 
0266 configure_file(config-workspace.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-workspace.h)
0267 configure_file(config-X11.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-X11.h)
0268 configure_file(config-build-options.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-build-options.h)
0269 
0270 plasma_install_package(desktoppackage org.kde.plasma.desktop shells shell)
0271 
0272 add_subdirectory(layout-templates)
0273 
0274 add_subdirectory(doc)
0275 add_subdirectory(runners)
0276 add_subdirectory(containments)
0277 add_subdirectory(toolboxes)
0278 add_subdirectory(applets)
0279 add_subdirectory(kcms)
0280 add_subdirectory(knetattach)
0281 if(KAccounts6_FOUND AND AccountsQt6_FOUND)
0282     add_subdirectory(attica-kde)
0283 endif()
0284 add_subdirectory(imports/activitymanager/)
0285 add_subdirectory(solid-device-automounter)
0286 add_subdirectory(emojier)
0287 if(X11_Xkb_FOUND AND XCB_XKB_FOUND)
0288     add_subdirectory(kaccess)
0289 endif()
0290 install(FILES org.kde.plasmashell.metainfo.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
0291 
0292 # add clang-format target for all our real source files
0293 file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES *.cpp *.h)
0294 kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES})
0295 kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)
0296 
0297 feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
0298 
0299 find_package(XdgUserDir)
0300 set_package_properties(XdgUserDir PROPERTIES
0301     DESCRIPTION "Xdg-user-dir script"
0302     PURPOSE "Used to translate default paths in KCM desktoppath"
0303     TYPE RUNTIME
0304 )
0305 
0306 find_package(FontNotoColorEmoji)
0307 set_package_properties(FontNotoColorEmoji PROPERTIES
0308     PURPOSE "Default emoji font, needed to display emojis properly in Emoji Selector"
0309     URL "https://www.google.com/get/noto/"
0310     TYPE RUNTIME
0311 )
0312 
0313 add_subdirectory(appiumtests)
0314 
0315 ki18n_install(po)
0316 kdoctools_install(po)