Warning, /plasma/plasma-workspace/CMakeLists.txt is written in an unsupported language. File is not indexed.
0001 cmake_minimum_required(VERSION 3.16) 0002 0003 project(plasma-workspace) 0004 set(PROJECT_VERSION "5.27.10") 0005 set(PROJECT_VERSION_MAJOR 5) 0006 0007 set(QT_MIN_VERSION "5.15.2") 0008 set(KF5_MIN_VERSION "5.102.0") 0009 set(KDE_COMPILERSETTINGS_LEVEL "5.82") 0010 set(INSTALL_SDDM_THEME TRUE) 0011 option(INSTALL_SDDM_WAYLAND_SESSION OFF) 0012 option(WITH_X11 "Build with X11 support. Building without is experimental" ON) 0013 0014 set(CMAKE_CXX_STANDARD 17) 0015 set(CMAKE_CXX_STANDARD_REQUIRED ON) 0016 0017 find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE) 0018 set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake) 0019 0020 include(KDEInstallDirs) 0021 include(KDECMakeSettings) 0022 include(KDECompilerSettings NO_POLICY_SCOPE) 0023 include(ECMMarkNonGuiExecutable) 0024 include(CMakePackageConfigHelpers) 0025 include(WriteBasicConfigVersionFile) 0026 include(CheckIncludeFiles) 0027 include(FeatureSummary) 0028 include(ECMOptionalAddSubdirectory) 0029 include(ECMQtDeclareLoggingCategory) 0030 include(ECMQueryQt) 0031 include(ECMInstallIcons) 0032 include(KDEClangFormat) 0033 include(KDEGitCommitHooks) 0034 include(ECMConfiguredInstall) 0035 include(ECMGenerateDBusServiceFile) 0036 include(ECMFindQmlModule) 0037 include(ECMGenerateExportHeader) 0038 include(ECMGenerateQmlTypes) 0039 include(ECMDeprecationSettings) 0040 0041 find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS Svg Widgets Quick QuickWidgets Concurrent Test Network) 0042 find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS 0043 Auth Plasma Runner Notifications NotifyConfig NewStuff Wallet IdleTime 0044 Declarative I18n KCMUtils TextWidgets Crash GlobalAccel DBusAddons Wayland 0045 CoreAddons People ActivitiesStats Activities KIO Prison PlasmaQuick Package 0046 GuiAddons Archive ItemModels IconThemes UnitConversion ItemModels TextEditor 0047 OPTIONAL_COMPONENTS DocTools) 0048 0049 find_package(KDED CONFIG REQUIRED) 0050 find_package(KPipeWire CONFIG) 0051 0052 find_package(KF5NetworkManagerQt ${KF5_MIN_VERSION}) 0053 set_package_properties(KF5NetworkManagerQt PROPERTIES DESCRIPTION "Qt wrapper for NetworkManager API" 0054 TYPE OPTIONAL 0055 PURPOSE "Needed by geolocation data engine." 0056 ) 0057 0058 find_package(KF5Kirigami2 ${KF5_MIN_VERSION} CONFIG) 0059 set_package_properties(KF5Kirigami2 PROPERTIES 0060 DESCRIPTION "A QtQuick based components set" 0061 TYPE RUNTIME 0062 ) 0063 0064 find_package(KF5QuickCharts ${KF5_MIN_VERSION} CONFIG) 0065 set_package_properties(KF5QuickCharts PROPERTIES 0066 DESCRIPTION "Used for rendering charts" 0067 TYPE RUNTIME 0068 ) 0069 0070 find_package(KUserFeedback) 0071 find_package(KSysGuard CONFIG REQUIRED) 0072 0073 find_package(KF5Baloo) 0074 set_package_properties(KF5Baloo PROPERTIES DESCRIPTION "File Searching" 0075 TYPE RECOMMENDED 0076 PURPOSE "Needed for the File Search runner." 0077 ) 0078 0079 find_package(PkgConfig REQUIRED) 0080 pkg_check_modules(QALCULATE libqalculate>2.0 REQUIRED IMPORTED_TARGET) 0081 0082 find_package(KWinDBusInterface CONFIG REQUIRED) 0083 0084 find_package(KF5Screen CONFIG REQUIRED) 0085 find_package(KScreenLocker 5.13.80 REQUIRED) 0086 find_package(ScreenSaverDBusInterface CONFIG REQUIRED) 0087 find_package(LayerShellQt CONFIG REQUIRED) 0088 find_package(KF5Holidays) 0089 set_package_properties(KF5Holidays PROPERTIES DESCRIPTION "Holidays provider for Plasma calendar" 0090 TYPE OPTIONAL 0091 PURPOSE "Needed to for holidays plugin for Plasma Calendar." 0092 ) 0093 0094 find_package(Phonon4Qt${QT_MAJOR_VERSION} 4.6.60 REQUIRED NO_MODULE) 0095 set_package_properties(Phonon4Qt${QT_MAJOR_VERSION} PROPERTIES 0096 DESCRIPTION "Qt-based audio library" 0097 TYPE REQUIRED) 0098 0099 find_package(Breeze ${PROJECT_VERSION} CONFIG) 0100 set_package_properties(Breeze PROPERTIES 0101 TYPE OPTIONAL 0102 PURPOSE "For setting the default window decoration plugin") 0103 0104 find_package(ZLIB) 0105 set_package_properties(ZLIB PROPERTIES DESCRIPTION "Support for gzip compressed files and data streams" 0106 URL "https://www.zlib.net" 0107 TYPE REQUIRED 0108 ) 0109 0110 find_package(Fontconfig) 0111 set_package_properties(Fontconfig PROPERTIES DESCRIPTION "Font access configuration library" 0112 URL "https://www.freedesktop.org/wiki/Software/fontconfig" 0113 TYPE OPTIONAL 0114 PURPOSE "Needed to build font configuration and installation tools" 0115 ) 0116 0117 if(WITH_X11) 0118 find_package(X11) 0119 set_package_properties(X11 PROPERTIES DESCRIPTION "X11 libraries" 0120 URL "https://www.x.org" 0121 TYPE REQUIRED 0122 PURPOSE "Required for building the X11 based workspace") 0123 function(check_X11_lib _lib) 0124 if (NOT TARGET X11::${_lib}) 0125 message(SEND_ERROR "Required component ${_lib} of X11 was not found") 0126 endif() 0127 endfunction() 0128 check_X11_lib(ICE) 0129 check_X11_lib(SM) 0130 check_X11_lib(X11) 0131 check_X11_lib(Xau) 0132 check_X11_lib(Xcursor) 0133 check_X11_lib(Xfixes) 0134 check_X11_lib(Xft) 0135 check_X11_lib(Xrender) 0136 check_X11_lib(Xtst) 0137 0138 set(HAVE_X11 1) 0139 set(HAVE_XCURSOR 1) 0140 set(HAVE_XFIXES 1) 0141 0142 find_package(XCB MODULE REQUIRED COMPONENTS XCB RANDR IMAGE) 0143 set_package_properties(XCB PROPERTIES TYPE REQUIRED) 0144 0145 if (QT_MAJOR_VERSION EQUAL "5") 0146 find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS X11Extras) 0147 endif() 0148 0149 else() 0150 set(HAVE_X11 0) 0151 set(HAVE_XCURSOR 0) 0152 set(HAVE_XFIXES 0) 0153 endif() 0154 0155 pkg_check_modules(PipeWire IMPORTED_TARGET libpipewire-0.3) 0156 add_feature_info(PipeWire PipeWire_FOUND "Required for Wayland screencasting") 0157 0158 if(PipeWire_FOUND) 0159 find_package(Libdrm REQUIRED) 0160 endif() 0161 0162 if(QT_MAJOR_VERSION EQUAL "5") 0163 find_package(QtWaylandScanner REQUIRED) 0164 find_package(Qt5XkbCommonSupport) 0165 else() 0166 find_package(Qt6 REQUIRED CONFIG COMPONENTS WaylandCompositor) 0167 endif() 0168 find_package(Qt${QT_MAJOR_VERSION}WaylandClient COMPONENTS Private) 0169 find_package(PlasmaWaylandProtocols 1.6 REQUIRED) 0170 find_package(Wayland REQUIRED COMPONENTS Client Server) # Server is used in autotests 0171 find_package(WaylandProtocols 1.31) 0172 set_package_properties(WaylandProtocols PROPERTIES 0173 TYPE OPTIONAL 0174 PURPOSE "Collection of Wayland protocols that add functionality not available in the Wayland core protocol" 0175 URL "https://gitlab.freedesktop.org/wayland/wayland-protocols/" 0176 ) 0177 if (WaylandProtocols_FOUND) 0178 set(HAVE_WaylandProtocols true) 0179 endif() 0180 0181 if(FONTCONFIG_FOUND) 0182 # kfontinst 0183 find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS PrintSupport) 0184 endif() 0185 0186 find_package(AppStreamQt 0.10.6) 0187 set_package_properties(AppStreamQt PROPERTIES DESCRIPTION "Access metadata for listing available software" 0188 URL "https://www.freedesktop.org/wiki/Distributions/AppStream/" 0189 TYPE OPTIONAL) 0190 0191 if(${AppStreamQt_FOUND}) 0192 set(HAVE_APPSTREAMQT true) 0193 endif() 0194 0195 0196 # Region & Language KCM 0197 if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") 0198 # notes for packager: 0199 # This is the macro definition part of Region & Language KCM 0200 # Depending on your distributions, the KCM behaves differently 0201 # For Ubuntu based systems, this KCM uses "check-language-support" and PackageKit 0202 # to install relevant fonts and packages 0203 # You should enable option UBUNTU_PACKAGEKIT (it's auto detected though) 0204 # 0205 # For Glibc systems that don't come with pre-generated locales, such as ArchLinux 0206 # This KCM uses "/etc/locale.gen" and "locale-gen" to generate configured locales 0207 # and display a note to let user install fonts themselves if required 0208 # You shouldn't required to do anything in this case 0209 # 0210 # For Glibc systems that come with pre-generated locales, such as Fedora and openSUSE 0211 # a note to let user install fonts themselves if required is displayed 0212 # You should enable GLIBC_LOCALE_PREGENERATED option 0213 # 0214 # For non-glibc systems such as VoidLinux and *BSD 0215 # A warning of configure locale manually is displayed (although the relevant ENVs are set by Plasma) 0216 # You should disable GLIBC_LOCALE_GEN option 0217 0218 0219 # find out if the build system is Ubuntu based 0220 if (${CMAKE_VERSION} VERSION_LESS 3.22) 0221 find_program(LSB_RELEASE_EXEC lsb_release) 0222 execute_process(COMMAND ${LSB_RELEASE_EXEC} -is 0223 OUTPUT_VARIABLE DISTRO_NAME 0224 OUTPUT_STRIP_TRAILING_WHITESPACE 0225 ) 0226 string(TOLOWER "${DISTRO_NAME}" DISTRO_NAME) 0227 else() 0228 cmake_host_system_information(RESULT DISTRO_NAME QUERY DISTRIB_ID) 0229 cmake_host_system_information(RESULT DISTRO_ID_LIKE QUERY DISTRIB_ID_LIKE) 0230 endif() 0231 0232 string(COMPARE EQUAL "ubuntu" "${DISTRO_NAME}" SYSTEM_UBUNTU_BASED) 0233 string(FIND "${DISTRO_ID_LIKE}" "ubuntu" FINDINDEX) 0234 if(NOT (FINDINDEX EQUAL -1)) 0235 set(SYSTEM_UBUNTU_BASED ON) 0236 endif() 0237 0238 option(UBUNTU_PACKAGEKIT "Install required package for language on Ubuntu Based systems, PackageKitQt5 required" ${SYSTEM_UBUNTU_BASED}) 0239 if(UBUNTU_PACKAGEKIT) 0240 set(OS_UBUNTU TRUE) 0241 endif() 0242 0243 set(GLIBC_LOCALE_GEN_DEFAULT ON) 0244 if(UBUNTU_PACKAGEKIT) 0245 set(GLIBC_LOCALE_GEN_DEFAULT OFF) 0246 endif() 0247 0248 option(GLIBC_LOCALE_GEN "Auto generate Glibc locale with locale-gen and /etc/locale.gen" ${GLIBC_LOCALE_GEN_DEFAULT}) 0249 if(GLIBC_LOCALE_GEN AND UBUNTU_PACKAGEKIT) 0250 message(FATAL_ERROR "UBUNTU_PACKAGEKIT and GLIBC_LOCALE_GEN both enabled, only UBUNTU_PACKEGKIT will be used") 0251 endif() 0252 if(GLIBC_LOCALE_GEN) 0253 set(GLIBC_LOCALE_AUTO TRUE) 0254 endif() 0255 if(UBUNTU_PACKAGEKIT OR GLIBC_LOCALE_GEN) 0256 set(REGION_LANG_GENERATE_LOCALE_HELPER TRUE) 0257 endif() 0258 0259 option(GLIBC_LOCALE_PREGENERATED "Systems that don't require locale generation. Such as openSUSE or Fedora" OFF) 0260 if(GLIBC_LOCALE_PREGENERATED) 0261 set(GLIBC_LOCALE_GENERATED TRUE) 0262 endif() 0263 if(REGION_LANG_GENERATE_LOCALE_HELPER AND GLIBC_LOCALE_PREGENERATED) 0264 message(FATAL_ERROR "(UBUNTU_PACKAGEKIT || GLIBC_LOCALE_GEN) and GLIBC_LOCALE_PREGENERATED both enabled") 0265 endif() 0266 0267 ################## Find libraries ################### 0268 if(REGION_LANG_GENERATE_LOCALE_HELPER) 0269 find_package(PolkitQt${QT_MAJOR_VERSION}-1) 0270 set_package_properties(PolkitQt${QT_MAJOR_VERSION}-1 0271 PROPERTIES DESCRIPTION "DBus interface wrapper for Polkit" 0272 PURPOSE "Communicate with localegen helper in region & lang kcm" 0273 TYPE REQUIRED 0274 ) 0275 endif() 0276 0277 if(UBUNTU_PACKAGEKIT) 0278 find_package(PackageKitQt${QT_MAJOR_VERSION}) 0279 set_package_properties(PackageKitQt${QT_MAJOR_VERSION} 0280 PROPERTIES DESCRIPTION "Software Manager integration" 0281 TYPE OPTIONAL 0282 PURPOSE "Used to install additional language packages on demand" 0283 ) 0284 0285 endif() 0286 endif() 0287 0288 find_package(ICU COMPONENTS i18n uc) 0289 set_package_properties(ICU 0290 PROPERTIES DESCRIPTION "Unicode and Globalization support for software applications" 0291 TYPE OPTIONAL 0292 PURPOSE "Better application groups in Kicker" 0293 ) 0294 if(${ICU_FOUND}) 0295 set(HAVE_ICU TRUE) 0296 endif() 0297 0298 find_package(KF5KExiv2) 0299 set_package_properties(KF5KExiv2 0300 PROPERTIES URL "https://www.exiv2.org" DESCRIPTION "Image metadata support" 0301 TYPE OPTIONAL 0302 PURPOSE "Provides metadata for image wallpaper plugin" 0303 ) 0304 if(${KF5KExiv2_FOUND}) 0305 set(HAVE_KF5KExiv2 TRUE) 0306 endif() 0307 0308 find_package(KIOExtras) 0309 set_package_properties(KIOExtras PROPERTIES DESCRIPTION "Common KIO slaves for operations." 0310 PURPOSE "Show thumbnails in wallpaper selection." 0311 TYPE RUNTIME 0312 ) 0313 0314 find_package(KIOFuse) 0315 set_package_properties(KIOFuse PROPERTIES DESCRIPTION "Provide KIO support to legacy applications. " 0316 TYPE RUNTIME 0317 ) 0318 0319 # Clipboard applet 0320 ecm_find_qmlmodule(org.kde.prison 1.0) 0321 0322 # Is building in KDE CI 0323 if(DEFINED ENV{KDECI_BUILD}) 0324 set(KDECI_BUILD true) 0325 endif() 0326 0327 include(ConfigureChecks.cmake) 0328 0329 include_directories("${CMAKE_CURRENT_BINARY_DIR}") 0330 0331 ecm_set_disabled_deprecation_versions( 0332 QT 5.15.2 0333 KF 5.98.0 0334 KDECLARATIVE 5.88.0 0335 ) 0336 0337 configure_file(config-workspace.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-workspace.h) 0338 configure_file(config-unix.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-unix.h ) 0339 configure_file(config-X11.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-X11.h) 0340 configure_file(config-appstream.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-appstream.h ) 0341 configure_file(config-WaylandProtocols.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-WaylandProtocols.h ) 0342 configure_file(config-KDECI_BUILD.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-KDECI_BUILD.h ) 0343 add_subdirectory(login-sessions) 0344 add_subdirectory(lookandfeel) 0345 0346 if (INSTALL_SDDM_WAYLAND_SESSION) 0347 install(FILES sddm-wayland-session/plasma-wayland.conf DESTINATION /etc/sddm.conf.d) 0348 else() 0349 message(STATUS "INSTALL_SDDM_WAYLAND_SESSION is disabled. As soon as it's installed, SDDM will default to use Wayland and KWin for its greeter session (BETA, do not deploy to final users yet).") 0350 endif() 0351 0352 add_definitions(-DQT_NO_URL_CAST_FROM_STRING) 0353 0354 # locate qdbus in the Qt path because not every distro makes a symlink at /usr/bin/qdbus 0355 ecm_query_qt(QtBinariesDir QT_INSTALL_BINS) 0356 0357 option(PLASMA_WAYLAND_DEFAULT_SESSION "Use Wayland session by default for Plasma" FALSE) 0358 0359 if(KF5DocTools_FOUND) 0360 add_subdirectory(doc) 0361 kdoctools_install(po) 0362 endif() 0363 add_subdirectory(libkworkspace) 0364 add_subdirectory(libdbusmenuqt) 0365 add_subdirectory(appmenu) 0366 0367 add_subdirectory(libtaskmanager) 0368 add_subdirectory(libnotificationmanager) 0369 add_subdirectory(libcolorcorrect) 0370 add_subdirectory(components) 0371 0372 add_subdirectory(plasma-windowed) 0373 add_subdirectory(shell) 0374 add_subdirectory(freespacenotifier) 0375 add_subdirectory(klipper) 0376 add_subdirectory(krunner) 0377 add_subdirectory(ksmserver) 0378 add_subdirectory(logout-greeter) 0379 add_subdirectory(ksplash) 0380 add_subdirectory(systemmonitor) 0381 add_subdirectory(statusnotifierwatcher) 0382 add_subdirectory(startkde) 0383 add_subdirectory(themes) 0384 0385 add_subdirectory(kcms) 0386 0387 add_subdirectory(containmentactions) 0388 add_subdirectory(runners) 0389 add_subdirectory(applets) 0390 add_subdirectory(dataengines) 0391 add_subdirectory(wallpapers) 0392 0393 add_subdirectory(kioworkers) 0394 add_subdirectory(ktimezoned) 0395 add_subdirectory(menu) 0396 add_subdirectory(phonon) 0397 0398 add_subdirectory(interactiveconsole) 0399 0400 # This ensures pressing the eject button on a CD drive ejects the disc 0401 # It listens to the Solid::OpticalDrive::ejectPressed signal that is only 0402 # supported by Solid in the HAL backend and does nothing with UDev 0403 if(CMAKE_SYSTEM_NAME MATCHES FreeBSD) 0404 add_subdirectory(solidautoeject) 0405 endif() 0406 0407 ecm_optional_add_subdirectory(xembed-sni-proxy) 0408 0409 ecm_optional_add_subdirectory(gmenu-dbusmenu-proxy) 0410 0411 add_subdirectory(soliduiserver) 0412 0413 if(KF5Holidays_FOUND) 0414 add_subdirectory(plasmacalendarintegration) 0415 endif() 0416 0417 add_subdirectory(appiumtests) 0418 0419 ki18n_install(po) 0420 0421 install(FILES completions/plasmashell.zsh RENAME _plasmashell DESTINATION ${KDE_INSTALL_ZSHAUTOCOMPLETEDIR}) 0422 0423 install(FILES plasma-workspace.categories DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR}) 0424 feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES) 0425 0426 # add clang-format target for all our real source files 0427 file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES *.cpp *.h) 0428 kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES}) 0429 kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)