2021-03-04 11:47:53 +00:00
|
|
|
cmake_minimum_required(VERSION 3.16)
|
2017-09-12 16:14:03 +00:00
|
|
|
|
2024-05-24 15:14:01 +00:00
|
|
|
set(PROJECT_VERSION "6.1.80") # Handled by release scripts
|
2020-11-07 19:34:55 +00:00
|
|
|
project(KWin VERSION ${PROJECT_VERSION})
|
2014-03-18 13:39:42 +00:00
|
|
|
|
2021-06-28 06:03:12 +00:00
|
|
|
set(CMAKE_C_STANDARD 99)
|
2022-10-31 17:18:33 +00:00
|
|
|
set(CMAKE_CXX_STANDARD 20)
|
|
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
2021-06-28 06:03:12 +00:00
|
|
|
|
2024-06-27 11:42:45 +00:00
|
|
|
set(PROJECT_DEP_VERSION "6.1.1")
|
2024-05-24 12:11:44 +00:00
|
|
|
set(QT_MIN_VERSION "6.6.0")
|
2024-05-24 10:22:28 +00:00
|
|
|
set(KF6_MIN_VERSION "6.2.0")
|
2021-10-11 19:59:39 +00:00
|
|
|
set(KDE_COMPILERSETTINGS_LEVEL "5.82")
|
2014-03-18 13:39:42 +00:00
|
|
|
|
2023-02-24 18:22:37 +00:00
|
|
|
find_package(ECM ${KF6_MIN_VERSION} REQUIRED NO_MODULE)
|
2014-03-18 13:39:42 +00:00
|
|
|
|
2022-10-31 17:17:32 +00:00
|
|
|
# where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked
|
|
|
|
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules ${ECM_MODULE_PATH})
|
|
|
|
|
|
|
|
include(CMakeDependentOption)
|
|
|
|
include(CMakePackageConfigHelpers)
|
2014-03-18 13:39:42 +00:00
|
|
|
include(FeatureSummary)
|
|
|
|
include(WriteBasicConfigVersionFile)
|
2014-04-03 08:15:57 +00:00
|
|
|
include(GenerateExportHeader)
|
2022-10-28 08:33:51 +00:00
|
|
|
include(CheckCXXCompilerFlag)
|
2022-10-31 17:17:32 +00:00
|
|
|
include(CheckIncludeFile)
|
|
|
|
include(CheckIncludeFiles)
|
|
|
|
include(CheckSymbolExists)
|
2014-03-18 13:39:42 +00:00
|
|
|
|
2022-03-10 18:11:26 +00:00
|
|
|
include(KDEInstallDirs)
|
|
|
|
include(KDECMakeSettings)
|
|
|
|
include(KDECompilerSettings NO_POLICY_SCOPE)
|
|
|
|
include(KDEClangFormat)
|
2022-03-25 09:32:46 +00:00
|
|
|
include(KDEGitCommitHooks)
|
2022-03-10 18:11:26 +00:00
|
|
|
|
2022-10-31 17:17:32 +00:00
|
|
|
include(ECMFindQmlModule)
|
2022-03-10 18:11:26 +00:00
|
|
|
include(ECMInstallIcons)
|
|
|
|
include(ECMOptionalAddSubdirectory)
|
|
|
|
include(ECMConfiguredInstall)
|
|
|
|
include(ECMQtDeclareLoggingCategory)
|
2023-03-27 08:10:48 +00:00
|
|
|
include(ECMSetupQtPluginMacroNames)
|
2023-06-19 11:19:29 +00:00
|
|
|
include(ECMSetupVersion)
|
2023-08-23 10:46:07 +00:00
|
|
|
include(ECMQmlModule)
|
|
|
|
include(ECMGenerateQmlTypes)
|
2022-03-10 18:11:26 +00:00
|
|
|
|
2023-05-12 15:24:04 +00:00
|
|
|
option(KWIN_BUILD_DECORATIONS "Enable building of KWin decorations." ON)
|
|
|
|
option(KWIN_BUILD_KCMS "Enable building of KWin configuration modules." ON)
|
|
|
|
option(KWIN_BUILD_NOTIFICATIONS "Enable building of KWin with knotifications support" ON)
|
|
|
|
option(KWIN_BUILD_SCREENLOCKER "Enable building of KWin lockscreen functionality" ON)
|
|
|
|
option(KWIN_BUILD_TABBOX "Enable building of KWin Tabbox functionality" ON)
|
2024-07-13 19:41:50 +00:00
|
|
|
option(KWIN_BUILD_X11 "Enable building X11 common code and Xwayland support" ON)
|
|
|
|
option(KWIN_BUILD_X11_BACKEND "Enable building kwin_x11" ON)
|
2024-06-16 21:25:25 +00:00
|
|
|
option(KWIN_BUILD_GLOBALSHORTCUTS "Enable building of KWin with global shortcuts support" ON)
|
|
|
|
option(KWIN_BUILD_RUNNERS "Enable building of KWin with krunner support" ON)
|
2023-05-12 15:24:04 +00:00
|
|
|
|
2023-05-29 12:30:41 +00:00
|
|
|
find_package(Qt6 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS
|
2014-03-18 13:39:42 +00:00
|
|
|
Concurrent
|
|
|
|
Core
|
2023-09-25 11:14:37 +00:00
|
|
|
Core5Compat
|
2014-03-18 13:39:42 +00:00
|
|
|
DBus
|
|
|
|
Quick
|
|
|
|
UiTools
|
2023-11-27 17:30:41 +00:00
|
|
|
WaylandClient
|
2014-03-18 13:39:42 +00:00
|
|
|
Widgets
|
2023-09-13 15:15:04 +00:00
|
|
|
Sensors
|
2014-03-18 13:39:42 +00:00
|
|
|
)
|
2014-04-16 20:26:01 +00:00
|
|
|
|
2023-05-29 12:30:41 +00:00
|
|
|
find_package(Qt6Test ${QT_MIN_VERSION} CONFIG QUIET)
|
|
|
|
set_package_properties(Qt6Test PROPERTIES
|
2019-09-17 09:15:35 +00:00
|
|
|
PURPOSE "Required for tests"
|
|
|
|
TYPE OPTIONAL
|
|
|
|
)
|
2023-05-29 12:30:41 +00:00
|
|
|
add_feature_info("Qt6Test" Qt6Test_FOUND "Required for building tests")
|
|
|
|
if (NOT Qt6Test_FOUND)
|
2014-04-16 20:26:01 +00:00
|
|
|
set(BUILD_TESTING OFF CACHE BOOL "Build the testing tree.")
|
|
|
|
endif()
|
|
|
|
|
2023-03-01 18:24:40 +00:00
|
|
|
if (BUILD_TESTING)
|
2023-02-21 02:37:30 +00:00
|
|
|
find_package(KPipeWire)
|
2023-03-01 18:24:40 +00:00
|
|
|
endif()
|
|
|
|
|
2014-03-18 13:39:42 +00:00
|
|
|
# required frameworks by Core
|
2023-02-24 18:22:37 +00:00
|
|
|
find_package(KF6 ${KF6_MIN_VERSION} REQUIRED COMPONENTS
|
2022-03-29 13:26:31 +00:00
|
|
|
Auth
|
2024-02-13 12:45:32 +00:00
|
|
|
ColorScheme
|
2014-03-18 13:39:42 +00:00
|
|
|
Config
|
|
|
|
ConfigWidgets
|
|
|
|
CoreAddons
|
|
|
|
Crash
|
2021-08-17 07:53:16 +00:00
|
|
|
DBusAddons
|
2014-03-18 13:39:42 +00:00
|
|
|
GlobalAccel
|
2023-11-23 22:28:13 +00:00
|
|
|
GuiAddons
|
2014-03-18 13:39:42 +00:00
|
|
|
I18n
|
2019-09-17 07:55:00 +00:00
|
|
|
IdleTime
|
2015-07-06 14:50:33 +00:00
|
|
|
Package
|
2023-06-29 10:50:24 +00:00
|
|
|
Service
|
2023-06-21 15:16:39 +00:00
|
|
|
Svg
|
2014-03-18 13:39:42 +00:00
|
|
|
WidgetsAddons
|
|
|
|
WindowSystem
|
|
|
|
)
|
|
|
|
# required frameworks by config modules
|
2023-05-12 15:24:04 +00:00
|
|
|
if(KWIN_BUILD_KCMS)
|
|
|
|
find_package(KF6 ${KF6_MIN_VERSION} REQUIRED COMPONENTS
|
|
|
|
Declarative
|
|
|
|
KCMUtils
|
|
|
|
NewStuff
|
|
|
|
Service
|
|
|
|
XmlGui
|
|
|
|
)
|
|
|
|
endif()
|
2014-03-18 13:39:42 +00:00
|
|
|
|
2015-03-31 07:30:19 +00:00
|
|
|
find_package(Threads)
|
|
|
|
set_package_properties(Threads PROPERTIES
|
2019-09-17 09:15:35 +00:00
|
|
|
PURPOSE "Needed for VirtualTerminal support in KWin Wayland"
|
|
|
|
TYPE REQUIRED
|
|
|
|
)
|
2015-03-31 07:30:19 +00:00
|
|
|
|
2024-06-27 11:42:45 +00:00
|
|
|
find_package(KWayland ${PROJECT_DEP_VERSION} CONFIG)
|
2023-11-23 19:34:24 +00:00
|
|
|
set_package_properties(KWayland PROPERTIES
|
2021-10-10 15:31:36 +00:00
|
|
|
PURPOSE "Required to build wayland platform plugin and tests"
|
|
|
|
TYPE REQUIRED
|
|
|
|
)
|
|
|
|
|
2014-03-18 13:39:42 +00:00
|
|
|
# optional frameworks
|
2024-06-27 11:42:45 +00:00
|
|
|
find_package(PlasmaActivities ${PROJECT_DEP_VERSION} CONFIG)
|
2023-11-23 20:48:01 +00:00
|
|
|
set_package_properties(PlasmaActivities PROPERTIES
|
2019-09-17 09:15:35 +00:00
|
|
|
PURPOSE "Enable building of KWin with kactivities support"
|
|
|
|
TYPE OPTIONAL
|
|
|
|
)
|
2023-11-23 20:48:01 +00:00
|
|
|
add_feature_info("PlasmaActivities" PlasmaActivities_FOUND "Enable building of KWin with kactivities support")
|
2014-04-23 18:28:30 +00:00
|
|
|
|
2023-02-24 18:22:37 +00:00
|
|
|
find_package(KF6DocTools ${KF6_MIN_VERSION} CONFIG)
|
|
|
|
set_package_properties(KF6DocTools PROPERTIES
|
2019-09-17 09:15:35 +00:00
|
|
|
PURPOSE "Enable building documentation"
|
|
|
|
TYPE OPTIONAL
|
|
|
|
)
|
2023-02-24 18:22:37 +00:00
|
|
|
add_feature_info("KF6DocTools" KF6DocTools_FOUND "Enable building documentation")
|
2014-03-18 13:39:42 +00:00
|
|
|
|
2024-04-06 10:51:53 +00:00
|
|
|
find_package(KF6Kirigami ${KF6_MIN_VERSION} CONFIG)
|
|
|
|
set_package_properties(KF6Kirigami PROPERTIES
|
2019-01-17 20:49:12 +00:00
|
|
|
DESCRIPTION "A QtQuick based components set"
|
2023-08-22 08:21:21 +00:00
|
|
|
PURPOSE "Required at runtime for several QML effects"
|
|
|
|
TYPE RUNTIME
|
|
|
|
)
|
2024-06-27 11:42:45 +00:00
|
|
|
find_package(Plasma ${PROJECT_DEP_VERSION} CONFIG)
|
2023-11-24 13:53:54 +00:00
|
|
|
set_package_properties(Plasma PROPERTIES
|
2023-08-22 08:21:21 +00:00
|
|
|
DESCRIPTION "A QtQuick based components set"
|
|
|
|
PURPOSE "Required at runtime for several QML effects"
|
2019-01-17 20:49:12 +00:00
|
|
|
TYPE RUNTIME
|
|
|
|
)
|
|
|
|
|
2024-06-27 11:42:45 +00:00
|
|
|
find_package(KDecoration2 ${PROJECT_DEP_VERSION} CONFIG)
|
2022-10-31 17:25:47 +00:00
|
|
|
set_package_properties(KDecoration2 PROPERTIES
|
|
|
|
TYPE REQUIRED
|
|
|
|
PURPOSE "Required for server side decoration support"
|
|
|
|
)
|
2014-09-19 11:59:51 +00:00
|
|
|
|
2017-02-17 13:59:20 +00:00
|
|
|
find_package(Breeze 5.9.0 CONFIG)
|
2016-04-07 12:25:42 +00:00
|
|
|
set_package_properties(Breeze PROPERTIES
|
2019-09-17 09:15:35 +00:00
|
|
|
TYPE OPTIONAL
|
|
|
|
PURPOSE "For setting the default window decoration plugin"
|
|
|
|
)
|
|
|
|
if (${Breeze_FOUND})
|
|
|
|
if (${BREEZE_WITH_KDECORATION})
|
2016-04-07 12:25:42 +00:00
|
|
|
set(HAVE_BREEZE_DECO true)
|
|
|
|
else()
|
|
|
|
set(HAVE_BREEZE_DECO FALSE)
|
|
|
|
endif()
|
|
|
|
else()
|
|
|
|
set(HAVE_BREEZE_DECO FALSE)
|
|
|
|
endif()
|
|
|
|
add_feature_info("Breeze-Decoration" HAVE_BREEZE_DECO "Default decoration plugin Breeze")
|
|
|
|
|
2014-03-18 13:39:42 +00:00
|
|
|
find_package(EGL)
|
|
|
|
set_package_properties(EGL PROPERTIES
|
2022-08-08 12:03:58 +00:00
|
|
|
TYPE REQUIRED
|
2019-09-17 09:15:35 +00:00
|
|
|
PURPOSE "Required to build KWin with EGL support"
|
|
|
|
)
|
2014-03-18 13:39:42 +00:00
|
|
|
|
2022-01-02 20:30:06 +00:00
|
|
|
find_package(epoxy 1.3)
|
2019-09-17 09:15:35 +00:00
|
|
|
set_package_properties(epoxy PROPERTIES
|
|
|
|
DESCRIPTION "libepoxy"
|
|
|
|
URL "https://github.com/anholt/libepoxy"
|
|
|
|
TYPE REQUIRED
|
|
|
|
PURPOSE "OpenGL dispatch library"
|
|
|
|
)
|
2014-02-10 16:34:09 +00:00
|
|
|
|
2016-11-22 07:34:59 +00:00
|
|
|
set(HAVE_DL_LIBRARY FALSE)
|
2019-09-17 09:15:35 +00:00
|
|
|
if (epoxy_HAS_GLX)
|
2016-11-22 07:34:59 +00:00
|
|
|
find_library(DL_LIBRARY dl)
|
2019-09-17 09:15:35 +00:00
|
|
|
if (DL_LIBRARY)
|
2016-11-22 07:34:59 +00:00
|
|
|
set(HAVE_DL_LIBRARY TRUE)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2023-02-08 20:43:16 +00:00
|
|
|
find_package(Wayland 1.22)
|
2014-03-18 13:39:42 +00:00
|
|
|
set_package_properties(Wayland PROPERTIES
|
2019-09-17 09:15:35 +00:00
|
|
|
TYPE REQUIRED
|
|
|
|
PURPOSE "Required for building KWin with Wayland support"
|
|
|
|
)
|
2024-04-12 11:58:15 +00:00
|
|
|
if (Wayland_VERSION VERSION_GREATER_EQUAL 1.23)
|
|
|
|
set(HAVE_WL_DISPLAY_SET_DEFAULT_MAX_BUFFER_SIZE 1)
|
|
|
|
else()
|
|
|
|
set(HAVE_WL_DISPLAY_SET_DEFAULT_MAX_BUFFER_SIZE 0)
|
|
|
|
endif()
|
2022-04-22 09:27:33 +00:00
|
|
|
|
2024-03-21 13:54:32 +00:00
|
|
|
find_package(WaylandProtocols 1.34)
|
2022-04-22 09:27:33 +00:00
|
|
|
set_package_properties(WaylandProtocols PROPERTIES
|
|
|
|
TYPE REQUIRED
|
|
|
|
PURPOSE "Collection of Wayland protocols that add functionality not available in the Wayland core protocol"
|
|
|
|
URL "https://gitlab.freedesktop.org/wayland/wayland-protocols/"
|
|
|
|
)
|
|
|
|
|
2024-07-17 09:20:38 +00:00
|
|
|
find_package(PlasmaWaylandProtocols 1.14.0 CONFIG)
|
2022-04-22 09:27:33 +00:00
|
|
|
set_package_properties(PlasmaWaylandProtocols PROPERTIES
|
|
|
|
TYPE REQUIRED
|
|
|
|
PURPOSE "Collection of Plasma-specific Wayland protocols"
|
|
|
|
URL "https://invent.kde.org/libraries/plasma-wayland-protocols/"
|
|
|
|
)
|
|
|
|
|
2021-03-02 01:14:39 +00:00
|
|
|
find_package(XKB 0.7.0)
|
2014-03-18 13:39:42 +00:00
|
|
|
set_package_properties(XKB PROPERTIES
|
2019-09-17 09:15:35 +00:00
|
|
|
TYPE REQUIRED
|
|
|
|
PURPOSE "Required for building KWin with Wayland support"
|
|
|
|
)
|
2023-01-07 00:53:55 +00:00
|
|
|
if (XKB_VERSION VERSION_GREATER_EQUAL 1.5.0)
|
|
|
|
set(HAVE_XKBCOMMON_NO_SECURE_GETENV 1)
|
|
|
|
else()
|
|
|
|
set(HAVE_XKBCOMMON_NO_SECURE_GETENV 0)
|
|
|
|
endif()
|
2014-03-18 13:39:42 +00:00
|
|
|
|
2024-07-08 11:55:10 +00:00
|
|
|
find_package(Canberra REQUIRED)
|
|
|
|
|
2023-12-15 16:58:46 +00:00
|
|
|
if (KWIN_BUILD_X11)
|
|
|
|
pkg_check_modules(XKBX11 IMPORTED_TARGET xkbcommon-x11 REQUIRED)
|
|
|
|
add_feature_info(XKBX11 XKBX11_FOUND "Required for handling keyboard events in X11 backend")
|
|
|
|
|
|
|
|
# All the required XCB components
|
|
|
|
find_package(XCB 1.10 REQUIRED COMPONENTS
|
|
|
|
COMPOSITE
|
|
|
|
CURSOR
|
|
|
|
DAMAGE
|
|
|
|
DRI3
|
|
|
|
GLX
|
|
|
|
ICCCM
|
|
|
|
IMAGE
|
|
|
|
KEYSYMS
|
|
|
|
PRESENT
|
|
|
|
RANDR
|
|
|
|
RENDER
|
|
|
|
SHAPE
|
|
|
|
SHM
|
|
|
|
SYNC
|
|
|
|
XCB
|
|
|
|
XFIXES
|
|
|
|
XKB
|
|
|
|
XINERAMA
|
2024-02-27 14:02:20 +00:00
|
|
|
XINPUT
|
2023-12-15 16:58:46 +00:00
|
|
|
)
|
|
|
|
set_package_properties(XCB PROPERTIES TYPE REQUIRED)
|
|
|
|
|
|
|
|
find_package(X11_XCB)
|
|
|
|
set_package_properties(X11_XCB PROPERTIES
|
|
|
|
PURPOSE "Required for building X11 windowed backend of kwin_wayland"
|
|
|
|
TYPE OPTIONAL
|
|
|
|
)
|
|
|
|
|
|
|
|
find_package(Xwayland)
|
|
|
|
set_package_properties(Xwayland PROPERTIES
|
|
|
|
URL "https://x.org"
|
|
|
|
DESCRIPTION "Xwayland X server"
|
|
|
|
TYPE RUNTIME
|
|
|
|
PURPOSE "Needed for running kwin_wayland"
|
|
|
|
)
|
|
|
|
set(HAVE_XWAYLAND_LISTENFD ${Xwayland_HAVE_LISTENFD})
|
2024-04-15 14:51:07 +00:00
|
|
|
set(HAVE_XWAYLAND_ENABLE_EI_PORTAL ${Xwayland_HAVE_ENABLE_EI_PORTAL})
|
2023-12-15 16:58:46 +00:00
|
|
|
|
|
|
|
set(HAVE_GLX ${epoxy_HAS_GLX})
|
|
|
|
get_target_property(QT_DISABLED_FEATURES Qt6::Gui QT_DISABLED_PUBLIC_FEATURES)
|
|
|
|
if("xcb_glx_plugin" IN_LIST QT_DISABLED_FEATURES)
|
|
|
|
message(STATUS "Disable GLX because Qt6::Gui was built without xcb_glx_plugin")
|
|
|
|
set(HAVE_GLX false)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# for kwin internal things
|
|
|
|
set(HAVE_X11_XCB ${X11_XCB_FOUND})
|
2024-07-13 19:41:50 +00:00
|
|
|
else()
|
|
|
|
set(KWIN_BUILD_X11_BACKEND OFF CACHE BOOL "Enable building kwin_x11" FORCE)
|
2023-12-15 16:58:46 +00:00
|
|
|
endif()
|
2022-09-08 10:54:47 +00:00
|
|
|
|
2021-08-05 08:31:08 +00:00
|
|
|
find_package(Libinput 1.19)
|
2018-01-23 16:28:18 +00:00
|
|
|
set_package_properties(Libinput PROPERTIES TYPE REQUIRED PURPOSE "Required for input handling on Wayland.")
|
2014-08-14 12:43:57 +00:00
|
|
|
|
2024-03-21 11:11:16 +00:00
|
|
|
find_package(Libeis-1.0)
|
|
|
|
set_package_properties(Libeis PROPERTIES TYPE OPTIONAL PURPOSE "Required for emulated input handling.")
|
|
|
|
|
2014-08-14 12:43:57 +00:00
|
|
|
find_package(UDev)
|
2019-09-17 09:15:35 +00:00
|
|
|
set_package_properties(UDev PROPERTIES
|
2019-11-26 17:39:20 +00:00
|
|
|
URL "https://www.freedesktop.org/wiki/Software/systemd/"
|
2019-09-17 09:15:35 +00:00
|
|
|
DESCRIPTION "Linux device library."
|
|
|
|
TYPE REQUIRED
|
|
|
|
PURPOSE "Required for input handling on Wayland."
|
|
|
|
)
|
2014-08-14 12:43:57 +00:00
|
|
|
|
2024-04-14 16:34:28 +00:00
|
|
|
find_package(Libdrm 2.4.116)
|
2021-05-14 09:57:54 +00:00
|
|
|
set_package_properties(Libdrm PROPERTIES TYPE REQUIRED PURPOSE "Required for drm output on Wayland.")
|
2015-04-09 12:49:32 +00:00
|
|
|
|
2015-04-10 08:44:07 +00:00
|
|
|
find_package(gbm)
|
2021-11-10 11:41:57 +00:00
|
|
|
set_package_properties(gbm PROPERTIES TYPE REQUIRED PURPOSE "Required for egl output of drm backend.")
|
2023-05-03 12:07:37 +00:00
|
|
|
if (gbm_VERSION VERSION_GREATER_EQUAL 21.1)
|
2021-08-25 13:03:04 +00:00
|
|
|
set(HAVE_GBM_BO_GET_FD_FOR_PLANE 1)
|
|
|
|
else()
|
|
|
|
set(HAVE_GBM_BO_GET_FD_FOR_PLANE 0)
|
|
|
|
endif()
|
2023-05-03 12:07:37 +00:00
|
|
|
if (gbm_VERSION VERSION_GREATER_EQUAL 21.3)
|
2022-12-20 12:24:48 +00:00
|
|
|
set(HAVE_GBM_BO_CREATE_WITH_MODIFIERS2 1)
|
|
|
|
else()
|
|
|
|
set(HAVE_GBM_BO_CREATE_WITH_MODIFIERS2 0)
|
|
|
|
endif()
|
2015-04-10 08:44:07 +00:00
|
|
|
|
2022-05-11 21:24:09 +00:00
|
|
|
pkg_check_modules(Libxcvt IMPORTED_TARGET libxcvt>=0.1.1 REQUIRED)
|
2022-04-12 14:28:56 +00:00
|
|
|
add_feature_info(Libxcvt Libxcvt_FOUND "Required for generating modes in the drm backend")
|
|
|
|
|
2014-03-18 13:39:42 +00:00
|
|
|
find_package(X11)
|
2019-09-17 09:15:35 +00:00
|
|
|
set_package_properties(X11 PROPERTIES
|
|
|
|
DESCRIPTION "X11 libraries"
|
|
|
|
URL "https://www.x.org"
|
|
|
|
TYPE REQUIRED
|
|
|
|
)
|
2021-01-05 21:22:06 +00:00
|
|
|
add_feature_info("XInput" X11_Xi_FOUND "Required for poll-free mouse cursor updates")
|
2016-01-13 14:40:02 +00:00
|
|
|
set(HAVE_X11_XINPUT ${X11_Xinput_FOUND})
|
2014-03-18 13:39:42 +00:00
|
|
|
|
2020-11-07 18:17:16 +00:00
|
|
|
find_package(lcms2)
|
|
|
|
set_package_properties(lcms2 PROPERTIES
|
|
|
|
DESCRIPTION "Small-footprint color management engine"
|
|
|
|
URL "http://www.littlecms.com"
|
2022-01-10 12:15:54 +00:00
|
|
|
TYPE REQUIRED
|
|
|
|
PURPOSE "Required for the color management system"
|
2020-11-07 18:17:16 +00:00
|
|
|
)
|
|
|
|
|
2022-10-31 17:28:09 +00:00
|
|
|
find_package(Freetype)
|
2019-09-17 09:15:35 +00:00
|
|
|
set_package_properties(Freetype PROPERTIES
|
|
|
|
DESCRIPTION "A font rendering engine"
|
|
|
|
URL "https://www.freetype.org"
|
|
|
|
TYPE REQUIRED
|
|
|
|
PURPOSE "Needed for KWin's QPA plugin."
|
|
|
|
)
|
2022-10-31 17:28:09 +00:00
|
|
|
find_package(Fontconfig)
|
2018-12-12 18:15:53 +00:00
|
|
|
set_package_properties(Fontconfig PROPERTIES
|
2019-09-17 09:15:35 +00:00
|
|
|
TYPE REQUIRED
|
|
|
|
PURPOSE "Needed for KWin's QPA plugin."
|
|
|
|
)
|
2015-08-14 14:52:40 +00:00
|
|
|
|
2017-09-10 10:05:29 +00:00
|
|
|
find_package(Libcap)
|
|
|
|
set_package_properties(Libcap PROPERTIES
|
|
|
|
TYPE OPTIONAL
|
|
|
|
PURPOSE "Needed for running kwin_wayland with real-time scheduling policy"
|
|
|
|
)
|
|
|
|
set(HAVE_LIBCAP ${Libcap_FOUND})
|
|
|
|
|
Decode full monitor vendor name from EDID using hwdata
Test Plan:
KScreen now shows "Dell Inc." instead of DEL and
"Eizo Nano Corporation" instead of ENC in output names, which
matches closer to what's written on my monitors.
Reviewers: graesslin, davidedmundson, #plasma
Reviewed By: davidedmundson, #plasma
Subscribers: apol, feverfew, ngraham, davidedmundson, mart, kwin, sebas
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D10041
2020-02-26 11:37:01 +00:00
|
|
|
find_package(hwdata)
|
|
|
|
set_package_properties(hwdata PROPERTIES
|
|
|
|
TYPE RUNTIME
|
|
|
|
PURPOSE "Runtime-only dependency needed for mapping monitor hardware vendor IDs to full names"
|
|
|
|
URL "https://github.com/vcrhonek/hwdata"
|
|
|
|
)
|
|
|
|
|
2023-03-12 21:49:21 +00:00
|
|
|
find_package(QAccessibilityClient6 CONFIG)
|
|
|
|
set_package_properties(QAccessibilityClient6 PROPERTIES
|
|
|
|
URL "https://commits.kde.org/libqaccessibilityclient"
|
2020-05-17 06:26:41 +00:00
|
|
|
DESCRIPTION "KDE client-side accessibility library"
|
|
|
|
TYPE OPTIONAL
|
|
|
|
PURPOSE "Required to enable accessibility features"
|
|
|
|
)
|
2023-03-12 21:49:21 +00:00
|
|
|
set(HAVE_ACCESSIBILITY ${QAccessibilityClient6_FOUND})
|
2020-05-17 06:26:41 +00:00
|
|
|
|
2024-01-02 17:34:26 +00:00
|
|
|
pkg_check_modules(libsystemd IMPORTED_TARGET libsystemd)
|
|
|
|
add_feature_info(libsystemd libsystemd_FOUND "Required for setting up the service watchdog")
|
|
|
|
|
2023-11-20 22:28:23 +00:00
|
|
|
if(KWIN_BUILD_GLOBALSHORTCUTS)
|
|
|
|
find_package(KGlobalAccelD REQUIRED)
|
|
|
|
endif()
|
2024-06-16 21:25:25 +00:00
|
|
|
|
2023-07-17 08:19:39 +00:00
|
|
|
pkg_check_modules(libdisplayinfo IMPORTED_TARGET display-info)
|
|
|
|
if (NOT libdisplayinfo_FOUND)
|
|
|
|
pkg_check_modules(libdisplayinfo REQUIRED IMPORTED_TARGET libdisplay-info)
|
|
|
|
endif()
|
2023-07-16 07:04:03 +00:00
|
|
|
add_feature_info(libdisplayinfo libdisplayinfo_FOUND "EDID and DisplayID library: https://gitlab.freedesktop.org/emersion/libdisplay-info")
|
2023-04-14 22:05:36 +00:00
|
|
|
|
2024-06-16 21:26:38 +00:00
|
|
|
pkg_check_modules(PipeWire IMPORTED_TARGET libpipewire-0.3>=0.3.29)
|
|
|
|
add_feature_info(PipeWire PipeWire_FOUND "Required for Wayland screencasting")
|
|
|
|
|
|
|
|
if (KWIN_BUILD_NOTIFICATIONS)
|
|
|
|
find_package(KF6 ${KF6_MIN_VERSION} REQUIRED COMPONENTS Notifications)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if (KWIN_BUILD_SCREENLOCKER)
|
|
|
|
find_package(KScreenLocker CONFIG)
|
|
|
|
set_package_properties(KScreenLocker PROPERTIES
|
|
|
|
TYPE REQUIRED
|
|
|
|
PURPOSE "For screenlocker integration in kwin_wayland"
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2017-08-12 12:01:45 +00:00
|
|
|
ecm_find_qmlmodule(QtQuick 2.3)
|
2022-08-02 16:06:54 +00:00
|
|
|
ecm_find_qmlmodule(QtQuick.Controls 2.15)
|
2017-08-12 12:01:45 +00:00
|
|
|
ecm_find_qmlmodule(QtQuick.Layouts 1.3)
|
|
|
|
ecm_find_qmlmodule(QtQuick.Window 2.1)
|
|
|
|
ecm_find_qmlmodule(QtMultimedia 5.0)
|
|
|
|
ecm_find_qmlmodule(org.kde.kquickcontrolsaddons 2.0)
|
|
|
|
ecm_find_qmlmodule(org.kde.plasma.core 2.0)
|
|
|
|
ecm_find_qmlmodule(org.kde.plasma.components 2.0)
|
|
|
|
|
2023-11-23 20:48:01 +00:00
|
|
|
cmake_dependent_option(KWIN_BUILD_ACTIVITIES "Enable building of KWin with kactivities support" ON "PlasmaActivities_FOUND" OFF)
|
2024-03-21 11:11:16 +00:00
|
|
|
cmake_dependent_option(KWIN_BUILD_EIS "Enable building KWin with libeis support" ON "Libeis-1.0_FOUND" OFF)
|
2011-07-06 15:42:24 +00:00
|
|
|
|
2011-08-11 16:03:01 +00:00
|
|
|
include_directories(BEFORE
|
2022-04-22 09:27:33 +00:00
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/src/wayland
|
2021-02-09 19:31:40 +00:00
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/src
|
2023-03-17 20:27:09 +00:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/src
|
2019-09-17 09:15:35 +00:00
|
|
|
)
|
2007-04-29 17:35:43 +00:00
|
|
|
|
2024-06-16 21:31:10 +00:00
|
|
|
check_symbol_exists(SCHED_RESET_ON_FORK "sched.h" HAVE_SCHED_RESET_ON_FORK)
|
|
|
|
add_feature_info("SCHED_RESET_ON_FORK"
|
|
|
|
HAVE_SCHED_RESET_ON_FORK
|
|
|
|
"Required for running kwin_wayland with real-time scheduling")
|
|
|
|
|
|
|
|
check_cxx_source_compiles("
|
|
|
|
#include <fcntl.h>
|
|
|
|
#include <sys/mman.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
|
|
|
|
int main() {
|
|
|
|
const int size = 10;
|
|
|
|
int fd = memfd_create(\"test\", MFD_CLOEXEC | MFD_ALLOW_SEALING);
|
|
|
|
ftruncate(fd, size);
|
|
|
|
fcntl(fd, F_ADD_SEALS, F_SEAL_SHRINK | F_SEAL_GROW | F_SEAL_WRITE | F_SEAL_SEAL);
|
|
|
|
mmap(nullptr, size, PROT_WRITE, MAP_SHARED, fd, 0);
|
|
|
|
}" HAVE_MEMFD)
|
|
|
|
|
2022-10-28 08:33:51 +00:00
|
|
|
check_cxx_compiler_flag(-Wno-unused-parameter COMPILER_UNUSED_PARAMETER_SUPPORTED)
|
|
|
|
if (COMPILER_UNUSED_PARAMETER_SUPPORTED)
|
|
|
|
add_compile_options(-Wno-unused-parameter)
|
|
|
|
endif()
|
|
|
|
|
2022-10-31 17:21:19 +00:00
|
|
|
add_definitions(
|
|
|
|
-DQT_DISABLE_DEPRECATED_BEFORE=0
|
|
|
|
-DQT_NO_KEYWORDS
|
|
|
|
-DQT_USE_QSTRINGBUILDER
|
|
|
|
-DQT_NO_URL_CAST_FROM_STRING
|
|
|
|
-DQT_NO_CAST_TO_ASCII
|
|
|
|
-DQT_NO_FOREACH
|
|
|
|
|
|
|
|
# Prevent EGL headers from including platform headers, in particular Xlib.h.
|
|
|
|
-DMESA_EGL_NO_X11_HEADERS
|
|
|
|
-DEGL_NO_X11
|
|
|
|
-DEGL_NO_PLATFORM_SPECIFIC_TYPES
|
|
|
|
)
|
|
|
|
|
2023-03-27 08:10:48 +00:00
|
|
|
ecm_setup_qtplugin_macro_names(
|
|
|
|
JSON_ARG2
|
|
|
|
"KWIN_EFFECT_FACTORY"
|
|
|
|
JSON_ARG3
|
|
|
|
"KWIN_EFFECT_FACTORY_ENABLED"
|
|
|
|
"KWIN_EFFECT_FACTORY_SUPPORTED"
|
|
|
|
JSON_ARG4
|
|
|
|
"KWIN_EFFECT_FACTORY_SUPPORTED_ENABLED"
|
|
|
|
CONFIG_CODE_VARIABLE
|
|
|
|
PACKAGE_SETUP_KWINEFFECTS_AUTOMOC_VARIABLES
|
|
|
|
)
|
|
|
|
|
2023-02-24 18:22:37 +00:00
|
|
|
if (KF6DocTools_FOUND)
|
2021-02-09 19:31:40 +00:00
|
|
|
add_subdirectory(doc)
|
2022-11-26 23:05:59 +00:00
|
|
|
kdoctools_install(po)
|
2013-02-25 10:14:56 +00:00
|
|
|
endif()
|
2011-04-28 14:18:15 +00:00
|
|
|
|
2019-09-17 09:15:35 +00:00
|
|
|
add_subdirectory(data)
|
2023-09-25 11:14:37 +00:00
|
|
|
add_subdirectory(kconf_update)
|
2021-02-09 19:31:40 +00:00
|
|
|
add_subdirectory(src)
|
2014-04-03 08:15:57 +00:00
|
|
|
|
2018-05-27 20:02:58 +00:00
|
|
|
if (BUILD_TESTING)
|
|
|
|
add_subdirectory(autotests)
|
|
|
|
add_subdirectory(tests)
|
|
|
|
endif()
|
|
|
|
|
2019-11-04 23:44:34 +00:00
|
|
|
# add clang-format target for all our real source files
|
|
|
|
file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES *.cpp *.h)
|
|
|
|
kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES})
|
2022-03-25 09:32:46 +00:00
|
|
|
kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)
|
2019-11-04 23:44:34 +00:00
|
|
|
|
2015-03-22 21:25:38 +00:00
|
|
|
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
|
|
|
|
|
2021-02-08 19:19:33 +00:00
|
|
|
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KWinDBusInterface")
|
2017-09-12 16:14:03 +00:00
|
|
|
configure_package_config_file(KWinDBusInterfaceConfig.cmake.in
|
2014-03-27 11:31:25 +00:00
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/KWinDBusInterfaceConfig.cmake"
|
2015-10-28 17:15:36 +00:00
|
|
|
PATH_VARS KDE_INSTALL_DBUSINTERFACEDIR
|
2014-03-27 11:31:25 +00:00
|
|
|
INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR})
|
2014-03-21 15:07:55 +00:00
|
|
|
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/KWinDBusInterfaceConfig.cmake
|
|
|
|
DESTINATION ${CMAKECONFIG_INSTALL_DIR})
|
2020-02-17 14:42:01 +00:00
|
|
|
|
2024-07-13 19:41:50 +00:00
|
|
|
ecm_install_configured_files(INPUT plasma-kwin_wayland.service.in @ONLY
|
2022-01-18 06:03:45 +00:00
|
|
|
DESTINATION ${KDE_INSTALL_SYSTEMDUSERUNITDIR})
|
2024-07-13 19:41:50 +00:00
|
|
|
if (KWIN_BUILD_X11_BACKEND)
|
|
|
|
ecm_install_configured_files(INPUT plasma-kwin_x11.service.in @ONLY
|
|
|
|
DESTINATION ${KDE_INSTALL_SYSTEMDUSERUNITDIR})
|
|
|
|
endif()
|
2022-10-02 14:45:13 +00:00
|
|
|
|
|
|
|
ki18n_install(po)
|