2021-03-04 14:47:53 +03:00
|
|
|
cmake_minimum_required(VERSION 3.16)
|
2017-09-12 19:14:03 +03:00
|
|
|
|
2021-05-13 17:09:31 +03:00
|
|
|
set(PROJECT_VERSION "5.22.80") # Handled by release scripts
|
2020-11-07 22:34:55 +03:00
|
|
|
project(KWin VERSION ${PROJECT_VERSION})
|
2014-03-18 17:39:42 +04:00
|
|
|
|
2020-09-17 08:02:13 +03:00
|
|
|
set(QT_MIN_VERSION "5.15.0")
|
2021-05-13 11:56:06 +03:00
|
|
|
set(KF5_MIN_VERSION "5.82")
|
2014-03-18 17:39:42 +04:00
|
|
|
|
2021-03-04 15:35:54 +03:00
|
|
|
find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
|
2014-03-18 17:39:42 +04:00
|
|
|
|
|
|
|
include(FeatureSummary)
|
|
|
|
include(WriteBasicConfigVersionFile)
|
2014-04-03 12:15:57 +04:00
|
|
|
include(GenerateExportHeader)
|
2014-03-18 17:39:42 +04:00
|
|
|
|
|
|
|
# where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked
|
2021-03-04 15:34:50 +03:00
|
|
|
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules ${ECM_MODULE_PATH})
|
2014-03-18 17:39:42 +04:00
|
|
|
|
|
|
|
find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS
|
|
|
|
Concurrent
|
|
|
|
Core
|
|
|
|
DBus
|
|
|
|
Quick
|
2014-10-31 09:53:04 +03:00
|
|
|
QuickWidgets
|
2014-03-18 17:39:42 +04:00
|
|
|
UiTools
|
|
|
|
Widgets
|
|
|
|
X11Extras
|
|
|
|
)
|
2014-04-17 00:26:01 +04:00
|
|
|
|
|
|
|
find_package(Qt5Test ${QT_MIN_VERSION} CONFIG QUIET)
|
|
|
|
set_package_properties(Qt5Test PROPERTIES
|
2019-09-17 12:15:35 +03:00
|
|
|
PURPOSE "Required for tests"
|
|
|
|
TYPE OPTIONAL
|
|
|
|
)
|
2014-04-17 00:26:01 +04:00
|
|
|
add_feature_info("Qt5Test" Qt5Test_FOUND "Required for building tests")
|
|
|
|
if (NOT Qt5Test_FOUND)
|
|
|
|
set(BUILD_TESTING OFF CACHE BOOL "Build the testing tree.")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
include(KDEInstallDirs)
|
|
|
|
include(KDECMakeSettings)
|
2016-01-28 17:08:23 +03:00
|
|
|
include(KDECompilerSettings NO_POLICY_SCOPE)
|
2019-11-05 12:47:05 +03:00
|
|
|
include(KDEClangFormat)
|
2014-04-17 00:26:01 +04:00
|
|
|
|
|
|
|
include(ECMInstallIcons)
|
2015-02-19 19:12:18 +03:00
|
|
|
include(ECMOptionalAddSubdirectory)
|
2020-02-17 17:42:01 +03:00
|
|
|
include(ECMConfiguredInstall)
|
2021-02-09 22:31:40 +03:00
|
|
|
include(ECMQtDeclareLoggingCategory)
|
2014-04-17 00:26:01 +04:00
|
|
|
|
2021-02-15 13:24:27 +03:00
|
|
|
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0 -DQT_USE_QSTRINGBUILDER -DQT_NO_URL_CAST_FROM_STRING -DQT_NO_CAST_TO_ASCII)
|
2014-03-18 17:39:42 +04:00
|
|
|
|
2020-12-10 12:01:12 +03:00
|
|
|
# Prevent EGL headers from including platform headers, in particular Xlib.h.
|
|
|
|
add_definitions(-DMESA_EGL_NO_X11_HEADERS)
|
|
|
|
add_definitions(-DEGL_NO_X11)
|
|
|
|
add_definitions(-DEGL_NO_PLATFORM_SPECIFIC_TYPES)
|
|
|
|
|
2020-09-28 16:01:01 +03:00
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
2017-02-07 22:49:22 +03:00
|
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
2014-05-14 12:13:23 +04:00
|
|
|
|
2014-03-18 17:39:42 +04:00
|
|
|
# required frameworks by Core
|
2014-09-19 09:44:42 +04:00
|
|
|
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
|
2014-03-18 17:39:42 +04:00
|
|
|
Config
|
|
|
|
ConfigWidgets
|
|
|
|
CoreAddons
|
|
|
|
Crash
|
|
|
|
GlobalAccel
|
|
|
|
I18n
|
2019-09-17 10:55:00 +03:00
|
|
|
IconThemes
|
|
|
|
IdleTime
|
2014-03-18 17:39:42 +04:00
|
|
|
Notifications
|
2015-07-06 17:50:33 +03:00
|
|
|
Package
|
2014-03-18 17:39:42 +04:00
|
|
|
Plasma
|
2019-09-17 10:55:00 +03:00
|
|
|
Wayland
|
2014-03-18 17:39:42 +04:00
|
|
|
WidgetsAddons
|
|
|
|
WindowSystem
|
|
|
|
)
|
|
|
|
# required frameworks by config modules
|
2014-09-19 09:44:42 +04:00
|
|
|
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
|
2014-03-18 17:39:42 +04:00
|
|
|
Completion
|
2014-04-02 14:02:36 +04:00
|
|
|
Declarative
|
2014-03-18 17:39:42 +04:00
|
|
|
KCMUtils
|
|
|
|
KIO
|
|
|
|
NewStuff
|
2015-07-07 18:35:57 +03:00
|
|
|
Service
|
2019-09-17 10:55:00 +03:00
|
|
|
TextWidgets
|
2014-03-18 17:39:42 +04:00
|
|
|
XmlGui
|
|
|
|
)
|
|
|
|
|
2015-03-31 10:30:19 +03:00
|
|
|
find_package(Threads)
|
|
|
|
set_package_properties(Threads PROPERTIES
|
2019-09-17 12:15:35 +03:00
|
|
|
PURPOSE "Needed for VirtualTerminal support in KWin Wayland"
|
|
|
|
TYPE REQUIRED
|
|
|
|
)
|
2015-03-31 10:30:19 +03:00
|
|
|
|
2014-03-18 17:39:42 +04:00
|
|
|
# optional frameworks
|
2014-09-19 09:44:42 +04:00
|
|
|
find_package(KF5Activities ${KF5_MIN_VERSION} CONFIG)
|
2014-04-23 22:28:30 +04:00
|
|
|
set_package_properties(KF5Activities PROPERTIES
|
2019-09-17 12:15:35 +03:00
|
|
|
PURPOSE "Enable building of KWin with kactivities support"
|
|
|
|
TYPE OPTIONAL
|
|
|
|
)
|
2014-04-23 22:28:30 +04:00
|
|
|
add_feature_info("KF5Activities" KF5Activities_FOUND "Enable building of KWin with kactivities support")
|
|
|
|
|
2014-09-19 09:44:42 +04:00
|
|
|
find_package(KF5DocTools ${KF5_MIN_VERSION} CONFIG)
|
2014-04-23 22:28:30 +04:00
|
|
|
set_package_properties(KF5DocTools PROPERTIES
|
2019-09-17 12:15:35 +03:00
|
|
|
PURPOSE "Enable building documentation"
|
|
|
|
TYPE OPTIONAL
|
|
|
|
)
|
2014-04-23 22:28:30 +04:00
|
|
|
add_feature_info("KF5DocTools" KF5DocTools_FOUND "Enable building documentation")
|
2014-03-18 17:39:42 +04:00
|
|
|
|
2020-07-21 16:33:03 +03:00
|
|
|
find_package(KF5Runner ${KF5_MIN_VERSION} CONFIG)
|
|
|
|
set_package_properties(KF5Runner PROPERTIES
|
|
|
|
PURPOSE "Enable building of KWin with krunner support"
|
|
|
|
TYPE OPTIONAL
|
|
|
|
)
|
|
|
|
add_feature_info("KF5Runner" KF5Runner_FOUND "Enable building of KWin with krunner support")
|
|
|
|
|
2019-01-17 23:49:12 +03:00
|
|
|
find_package(KF5Kirigami2 ${KF5_MIN_VERSION} CONFIG)
|
|
|
|
set_package_properties(KF5Kirigami2 PROPERTIES
|
|
|
|
DESCRIPTION "A QtQuick based components set"
|
2020-09-29 17:46:32 +03:00
|
|
|
PURPOSE "Required at runtime for Virtual desktop KCM"
|
2019-01-17 23:49:12 +03:00
|
|
|
TYPE RUNTIME
|
|
|
|
)
|
|
|
|
|
2020-01-30 00:20:55 +03:00
|
|
|
find_package(KDecoration2 5.18.0 CONFIG REQUIRED)
|
2014-09-19 15:59:51 +04:00
|
|
|
|
2015-11-05 16:09:23 +03:00
|
|
|
find_package(KScreenLocker CONFIG REQUIRED)
|
|
|
|
set_package_properties(KScreenLocker PROPERTIES
|
2019-09-17 12:15:35 +03:00
|
|
|
TYPE REQUIRED
|
|
|
|
PURPOSE "For screenlocker integration in kwin_wayland"
|
|
|
|
)
|
2015-11-05 16:09:23 +03:00
|
|
|
|
2020-04-29 18:18:41 +03:00
|
|
|
find_package(KWaylandServer CONFIG REQUIRED)
|
|
|
|
set_package_properties(KWaylandServer PROPERTIES
|
|
|
|
TYPE REQUIRED
|
|
|
|
PURPOSE "For Wayland integration"
|
|
|
|
)
|
|
|
|
|
2017-02-17 16:59:20 +03:00
|
|
|
find_package(Breeze 5.9.0 CONFIG)
|
2016-04-07 15:25:42 +03:00
|
|
|
set_package_properties(Breeze PROPERTIES
|
2019-09-17 12:15:35 +03:00
|
|
|
TYPE OPTIONAL
|
|
|
|
PURPOSE "For setting the default window decoration plugin"
|
|
|
|
)
|
|
|
|
if (${Breeze_FOUND})
|
|
|
|
if (${BREEZE_WITH_KDECORATION})
|
2016-04-07 15:25:42 +03: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 17:39:42 +04:00
|
|
|
find_package(EGL)
|
|
|
|
set_package_properties(EGL PROPERTIES
|
2019-09-17 12:15:35 +03:00
|
|
|
TYPE RUNTIME
|
|
|
|
PURPOSE "Required to build KWin with EGL support"
|
|
|
|
)
|
2014-03-18 17:39:42 +04:00
|
|
|
|
2014-02-10 20:34:09 +04:00
|
|
|
find_package(epoxy)
|
2019-09-17 12:15:35 +03:00
|
|
|
set_package_properties(epoxy PROPERTIES
|
|
|
|
DESCRIPTION "libepoxy"
|
|
|
|
URL "https://github.com/anholt/libepoxy"
|
|
|
|
TYPE REQUIRED
|
|
|
|
PURPOSE "OpenGL dispatch library"
|
|
|
|
)
|
2014-02-10 20:34:09 +04:00
|
|
|
|
2016-11-22 10:34:59 +03:00
|
|
|
set(HAVE_DL_LIBRARY FALSE)
|
2019-09-17 12:15:35 +03:00
|
|
|
if (epoxy_HAS_GLX)
|
2016-11-22 10:34:59 +03:00
|
|
|
find_library(DL_LIBRARY dl)
|
2019-09-17 12:15:35 +03:00
|
|
|
if (DL_LIBRARY)
|
2016-11-22 10:34:59 +03:00
|
|
|
set(HAVE_DL_LIBRARY TRUE)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2020-09-02 19:19:04 +03:00
|
|
|
find_package(Wayland 1.2 OPTIONAL_COMPONENTS Egl)
|
2014-03-18 17:39:42 +04:00
|
|
|
set_package_properties(Wayland PROPERTIES
|
2019-09-17 12:15:35 +03:00
|
|
|
TYPE REQUIRED
|
|
|
|
PURPOSE "Required for building KWin with Wayland support"
|
|
|
|
)
|
2020-09-02 14:36:19 +03:00
|
|
|
add_feature_info("Wayland::EGL" Wayland_Egl_FOUND "Enable building of Wayland backend.")
|
2015-11-30 10:34:52 +03:00
|
|
|
set(HAVE_WAYLAND_EGL FALSE)
|
2019-09-17 12:15:35 +03:00
|
|
|
if (Wayland_Egl_FOUND)
|
2015-11-30 10:34:52 +03:00
|
|
|
set(HAVE_WAYLAND_EGL TRUE)
|
|
|
|
endif()
|
2014-08-19 11:31:31 +04:00
|
|
|
|
2021-03-02 04:14:39 +03:00
|
|
|
find_package(XKB 0.7.0)
|
2014-03-18 17:39:42 +04:00
|
|
|
set_package_properties(XKB PROPERTIES
|
2019-09-17 12:15:35 +03:00
|
|
|
TYPE REQUIRED
|
|
|
|
PURPOSE "Required for building KWin with Wayland support"
|
|
|
|
)
|
2014-03-18 17:39:42 +04:00
|
|
|
|
2021-03-15 20:34:41 +03:00
|
|
|
find_package(Qt5XkbCommonSupport REQUIRED)
|
|
|
|
|
2018-01-16 22:54:11 +03:00
|
|
|
find_package(Libinput 1.9)
|
2018-01-23 19:28:18 +03:00
|
|
|
set_package_properties(Libinput PROPERTIES TYPE REQUIRED PURPOSE "Required for input handling on Wayland.")
|
2014-08-14 16:43:57 +04:00
|
|
|
|
|
|
|
find_package(UDev)
|
2019-09-17 12:15:35 +03:00
|
|
|
set_package_properties(UDev PROPERTIES
|
2019-11-26 20:39:20 +03:00
|
|
|
URL "https://www.freedesktop.org/wiki/Software/systemd/"
|
2019-09-17 12:15:35 +03:00
|
|
|
DESCRIPTION "Linux device library."
|
|
|
|
TYPE REQUIRED
|
|
|
|
PURPOSE "Required for input handling on Wayland."
|
|
|
|
)
|
2014-08-14 16:43:57 +04:00
|
|
|
|
2016-10-17 17:12:48 +03:00
|
|
|
find_package(Libdrm 2.4.62)
|
2015-04-09 15:49:32 +03:00
|
|
|
set_package_properties(Libdrm PROPERTIES TYPE OPTIONAL PURPOSE "Required for drm output on Wayland.")
|
|
|
|
set(HAVE_DRM FALSE)
|
2019-09-17 12:15:35 +03:00
|
|
|
if (Libdrm_FOUND)
|
2015-04-09 15:49:32 +03:00
|
|
|
set(HAVE_DRM TRUE)
|
|
|
|
endif()
|
|
|
|
|
2015-04-10 11:44:07 +03:00
|
|
|
find_package(gbm)
|
2018-08-29 21:02:16 +03:00
|
|
|
set_package_properties(gbm PROPERTIES TYPE OPTIONAL PURPOSE "Required for egl output of drm backend.")
|
2015-04-10 11:44:07 +03:00
|
|
|
set(HAVE_GBM FALSE)
|
2019-09-17 12:15:35 +03:00
|
|
|
if (HAVE_DRM AND gbm_FOUND)
|
2015-04-10 11:44:07 +03:00
|
|
|
set(HAVE_GBM TRUE)
|
|
|
|
endif()
|
|
|
|
|
[platforms/drm] EGLStream DRM Backend Initial Implementation
Summary:
This is the initial implementation of a DRM backend based on the EGLDevice,
EGLOutput, and EGLStream extensions, supporting NVIDIA graphics hardware using
their proprietary driver. The new backend will be used if the environment
variable KWIN_DRM_USE_EGL_STREAMS is set. On initialization, it will attempt to
create an EGLDevice based on the DRM device currently in use and create
EGLOutputs and EGLStreams for any attached displays. These are used to control
presentation of the final composited frame. Additionally, it will register the
wl_eglstream_controller Wayland interface so that native EGL windows created by
clients can be attached to an EGLStream allowing buffer contents to be shared
with the compositor as a GL texture.
At this time there are two known bugs in the NVIDIA driver's EGL implementation
affecting desktop functionality. The first can result in tooltip windows drawn
by plasmashell to contain incorrect contents. The second prevents KWayland from
being able to query the format of EGLStream-backed buffers which interferes
with the blur effect. Fixes for both of these are currently in development and
should appear in an upcoming NVIDIA driver release.
Additionally, hardware cursors are currently not supported with this backend.
Enabling them causes the desktop to intermittently hang for several seconds.
This is also likely a bug in the NVIDIA DRM-KMS implementation but the root
cause is still under investigation.
Test Plan:
On a system with an NVIDIA graphics card running a recent release of their
proprietary driver
* Ensure the nvidia_drm kernel module is loaded with the option "modeset=1"
("# cat /sys/module/nvidia_drm/parameters/modeset" should print "Y")
* Ensure EGL external platform support is installed
https://github.com/NVIDIA/eglexternalplatform
* Ensure KWin was build with the CMake option
KWIN_BUILD_EGL_STREAM_BACKEND=ON (this is the default)
* Start a plasma wayland session with the environment variable
KWIN_DRM_USE_EGL_STREAMS set
* Ensure output from KWin OpenGL initialization indicates the NVIDIA EGL
driver is in use (as opposed to Mesa / llvmpipe).
* Desktop should be fully functional and perform smoothly.
Reviewers: #kwin, romangg, davidedmundson
Reviewed By: #kwin, romangg, davidedmundson
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18570
2019-04-15 17:26:22 +03:00
|
|
|
option(KWIN_BUILD_EGL_STREAM_BACKEND "Enable building of EGLStream based DRM backend" ON)
|
2019-09-17 12:15:35 +03:00
|
|
|
if (HAVE_DRM AND KWIN_BUILD_EGL_STREAM_BACKEND)
|
[platforms/drm] EGLStream DRM Backend Initial Implementation
Summary:
This is the initial implementation of a DRM backend based on the EGLDevice,
EGLOutput, and EGLStream extensions, supporting NVIDIA graphics hardware using
their proprietary driver. The new backend will be used if the environment
variable KWIN_DRM_USE_EGL_STREAMS is set. On initialization, it will attempt to
create an EGLDevice based on the DRM device currently in use and create
EGLOutputs and EGLStreams for any attached displays. These are used to control
presentation of the final composited frame. Additionally, it will register the
wl_eglstream_controller Wayland interface so that native EGL windows created by
clients can be attached to an EGLStream allowing buffer contents to be shared
with the compositor as a GL texture.
At this time there are two known bugs in the NVIDIA driver's EGL implementation
affecting desktop functionality. The first can result in tooltip windows drawn
by plasmashell to contain incorrect contents. The second prevents KWayland from
being able to query the format of EGLStream-backed buffers which interferes
with the blur effect. Fixes for both of these are currently in development and
should appear in an upcoming NVIDIA driver release.
Additionally, hardware cursors are currently not supported with this backend.
Enabling them causes the desktop to intermittently hang for several seconds.
This is also likely a bug in the NVIDIA DRM-KMS implementation but the root
cause is still under investigation.
Test Plan:
On a system with an NVIDIA graphics card running a recent release of their
proprietary driver
* Ensure the nvidia_drm kernel module is loaded with the option "modeset=1"
("# cat /sys/module/nvidia_drm/parameters/modeset" should print "Y")
* Ensure EGL external platform support is installed
https://github.com/NVIDIA/eglexternalplatform
* Ensure KWin was build with the CMake option
KWIN_BUILD_EGL_STREAM_BACKEND=ON (this is the default)
* Start a plasma wayland session with the environment variable
KWIN_DRM_USE_EGL_STREAMS set
* Ensure output from KWin OpenGL initialization indicates the NVIDIA EGL
driver is in use (as opposed to Mesa / llvmpipe).
* Desktop should be fully functional and perform smoothly.
Reviewers: #kwin, romangg, davidedmundson
Reviewed By: #kwin, romangg, davidedmundson
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18570
2019-04-15 17:26:22 +03:00
|
|
|
set(HAVE_EGL_STREAMS TRUE)
|
|
|
|
endif()
|
|
|
|
|
2014-03-18 17:39:42 +04:00
|
|
|
find_package(X11)
|
2019-09-17 12:15:35 +03:00
|
|
|
set_package_properties(X11 PROPERTIES
|
|
|
|
DESCRIPTION "X11 libraries"
|
|
|
|
URL "https://www.x.org"
|
|
|
|
TYPE REQUIRED
|
|
|
|
)
|
2021-01-06 00:22:06 +03:00
|
|
|
add_feature_info("XInput" X11_Xi_FOUND "Required for poll-free mouse cursor updates")
|
2016-01-13 17:40:02 +03:00
|
|
|
set(HAVE_X11_XINPUT ${X11_Xinput_FOUND})
|
2014-03-18 17:39:42 +04:00
|
|
|
|
2020-11-07 21:17:16 +03:00
|
|
|
find_package(lcms2)
|
|
|
|
set_package_properties(lcms2 PROPERTIES
|
|
|
|
DESCRIPTION "Small-footprint color management engine"
|
|
|
|
URL "http://www.littlecms.com"
|
|
|
|
TYPE OPTIONAL
|
|
|
|
)
|
2020-11-27 22:37:40 +03:00
|
|
|
add_feature_info("lcms2" lcms2_FOUND "Required for the color management system")
|
2020-11-07 21:17:16 +03:00
|
|
|
|
2014-03-18 17:39:42 +04:00
|
|
|
# All the required XCB components
|
2019-09-17 12:15:35 +03:00
|
|
|
find_package(XCB 1.10 REQUIRED COMPONENTS
|
|
|
|
COMPOSITE
|
|
|
|
CURSOR
|
|
|
|
DAMAGE
|
|
|
|
GLX
|
|
|
|
ICCCM
|
|
|
|
IMAGE
|
|
|
|
KEYSYMS
|
|
|
|
RANDR
|
|
|
|
RENDER
|
|
|
|
SHAPE
|
|
|
|
SHM
|
|
|
|
SYNC
|
|
|
|
XCB
|
|
|
|
XFIXES
|
2014-03-18 17:39:42 +04:00
|
|
|
)
|
|
|
|
set_package_properties(XCB PROPERTIES TYPE REQUIRED)
|
|
|
|
|
|
|
|
# and the optional XCB dependencies
|
2014-06-11 09:51:07 +04:00
|
|
|
if (XCB_ICCCM_VERSION VERSION_LESS "0.4")
|
|
|
|
set(XCB_ICCCM_FOUND FALSE)
|
|
|
|
endif()
|
2014-03-18 17:39:42 +04:00
|
|
|
add_feature_info("XCB-ICCCM" XCB_ICCCM_FOUND "Required for building test applications for KWin")
|
|
|
|
|
2015-03-19 13:07:49 +03:00
|
|
|
find_package(X11_XCB)
|
|
|
|
set_package_properties(X11_XCB PROPERTIES
|
2019-09-17 12:15:35 +03:00
|
|
|
PURPOSE "Required for building X11 windowed backend of kwin_wayland"
|
|
|
|
TYPE OPTIONAL
|
|
|
|
)
|
2015-03-19 13:07:49 +03:00
|
|
|
|
2015-08-14 17:52:40 +03:00
|
|
|
# dependencies for QPA plugin
|
2017-10-16 18:25:21 +03:00
|
|
|
find_package(Qt5FontDatabaseSupport REQUIRED)
|
|
|
|
find_package(Qt5ThemeSupport REQUIRED)
|
|
|
|
find_package(Qt5EventDispatcherSupport REQUIRED)
|
2016-10-27 03:43:21 +03:00
|
|
|
|
2015-08-14 17:52:40 +03:00
|
|
|
find_package(Freetype REQUIRED)
|
2019-09-17 12:15:35 +03: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."
|
|
|
|
)
|
2015-08-14 17:52:40 +03:00
|
|
|
find_package(Fontconfig REQUIRED)
|
2018-12-12 21:15:53 +03:00
|
|
|
set_package_properties(Fontconfig PROPERTIES
|
2019-09-17 12:15:35 +03:00
|
|
|
TYPE REQUIRED
|
|
|
|
PURPOSE "Needed for KWin's QPA plugin."
|
|
|
|
)
|
2015-08-14 17:52:40 +03:00
|
|
|
|
2016-02-03 17:48:13 +03:00
|
|
|
find_package(Xwayland)
|
|
|
|
set_package_properties(Xwayland PROPERTIES
|
2019-03-25 21:11:15 +03:00
|
|
|
URL "https://x.org"
|
2016-02-03 17:48:13 +03:00
|
|
|
DESCRIPTION "Xwayland X server"
|
|
|
|
TYPE RUNTIME
|
|
|
|
PURPOSE "Needed for running kwin_wayland"
|
2019-09-17 12:15:35 +03:00
|
|
|
)
|
2021-02-26 11:48:47 +03:00
|
|
|
set(HAVE_XWAYLAND_LISTENFD ${Xwayland_HAVE_LISTENFD})
|
2016-02-03 17:48:13 +03:00
|
|
|
|
2017-09-10 13:05:29 +03: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 14:37:01 +03: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"
|
|
|
|
)
|
|
|
|
|
2020-05-17 09:26:41 +03:00
|
|
|
find_package(QAccessibilityClient CONFIG)
|
|
|
|
set_package_properties(QAccessibilityClient PROPERTIES
|
|
|
|
URL "https://www.kde.org"
|
|
|
|
DESCRIPTION "KDE client-side accessibility library"
|
|
|
|
TYPE OPTIONAL
|
|
|
|
PURPOSE "Required to enable accessibility features"
|
|
|
|
)
|
|
|
|
set(HAVE_ACCESSIBILITY ${QAccessibilityClient_FOUND})
|
|
|
|
|
2017-08-12 15:01:45 +03:00
|
|
|
include(ECMQMLModules)
|
|
|
|
ecm_find_qmlmodule(QtQuick 2.3)
|
|
|
|
ecm_find_qmlmodule(QtQuick.Controls 1.2)
|
|
|
|
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)
|
|
|
|
|
2008-01-03 18:22:19 +03:00
|
|
|
########### configure tests ###############
|
2013-11-15 16:37:47 +04:00
|
|
|
include(CMakeDependentOption)
|
|
|
|
|
|
|
|
option(KWIN_BUILD_DECORATIONS "Enable building of KWin decorations." ON)
|
|
|
|
option(KWIN_BUILD_KCMS "Enable building of KWin configuration modules." ON)
|
|
|
|
option(KWIN_BUILD_TABBOX "Enable building of KWin Tabbox functionality" ON)
|
|
|
|
option(KWIN_BUILD_XRENDER_COMPOSITING "Enable building of KWin with XRender Compositing support" ON)
|
2014-02-13 23:06:33 +04:00
|
|
|
cmake_dependent_option(KWIN_BUILD_ACTIVITIES "Enable building of KWin with kactivities support" ON "KF5Activities_FOUND" OFF)
|
2020-07-21 16:33:03 +03:00
|
|
|
cmake_dependent_option(KWIN_BUILD_RUNNERS "Enable building of KWin with krunner support" ON "KF5Runner_FOUND" OFF)
|
2020-11-27 22:37:40 +03:00
|
|
|
cmake_dependent_option(KWIN_BUILD_CMS "Enable building of KWin with CMS" ON "lcms2_FOUND" OFF)
|
2011-07-06 19:42:24 +04:00
|
|
|
|
2012-03-16 11:37:09 +04:00
|
|
|
# Binary name of KWin
|
|
|
|
set(KWIN_NAME "kwin")
|
2014-06-10 14:05:54 +04:00
|
|
|
set(KWIN_INTERNAL_NAME_X11 "kwin_x11")
|
|
|
|
set(KWIN_INTERNAL_NAME_WAYLAND "kwin_wayland")
|
2012-03-16 11:37:09 +04:00
|
|
|
|
2011-08-13 12:36:50 +04:00
|
|
|
# KWIN_HAVE_XRENDER_COMPOSITING - whether XRender-based compositing support is available: may be disabled
|
2019-09-17 12:15:35 +03:00
|
|
|
if (KWIN_BUILD_XRENDER_COMPOSITING)
|
|
|
|
set(KWIN_HAVE_XRENDER_COMPOSITING 1)
|
2013-02-25 14:14:56 +04:00
|
|
|
endif()
|
2008-01-03 18:22:19 +03:00
|
|
|
|
2021-03-02 04:14:39 +03:00
|
|
|
include_directories(${XKB_INCLUDE_DIR})
|
|
|
|
|
2015-10-30 13:50:31 +03:00
|
|
|
set(HAVE_EPOXY_GLX ${epoxy_HAS_GLX})
|
2014-10-24 23:58:59 +04:00
|
|
|
|
2008-01-03 18:22:19 +03:00
|
|
|
# for kwin internal things
|
2015-08-10 15:50:45 +03:00
|
|
|
set(HAVE_X11_XCB ${X11_XCB_FOUND})
|
2015-05-12 11:03:00 +03:00
|
|
|
|
2015-12-08 13:42:48 +03:00
|
|
|
include(CheckIncludeFile)
|
2014-03-18 17:39:42 +04:00
|
|
|
include(CheckIncludeFiles)
|
2015-12-08 13:42:48 +03:00
|
|
|
include(CheckSymbolExists)
|
2014-03-18 12:30:40 +04:00
|
|
|
check_include_files(unistd.h HAVE_UNISTD_H)
|
|
|
|
check_include_files(malloc.h HAVE_MALLOC_H)
|
2015-12-08 13:42:48 +03:00
|
|
|
|
|
|
|
check_include_file("sys/prctl.h" HAVE_SYS_PRCTL_H)
|
|
|
|
check_symbol_exists(PR_SET_DUMPABLE "sys/prctl.h" HAVE_PR_SET_DUMPABLE)
|
2017-04-26 07:57:32 +03:00
|
|
|
check_symbol_exists(PR_SET_PDEATHSIG "sys/prctl.h" HAVE_PR_SET_PDEATHSIG)
|
Disallow ptrace on greeter and kwin_wayland process on FreeBSD [... for the future]
Summary:
Similar to[[ https://phabricator.kde.org/D1216 | D1216 ]] add procctl call to disable ptrace on FreeBSD.
We cannot do the procfs-lookup to check whether the process is already being run inside gdb -- however, on FreeBSD, we could use the P_TRACED flag of the process to figure this out:
> sys/proc.h:#define P_TRACED 0x00800 /* Debugged process being traced. */
And the code would look something similar to
```
pid_t pid = getpid();
struct procstat *prstat = procstat_open_sysctl();
struct kinfo_proc *procinfo;
unsigned int cnt;
procinfo = procstat_getprocs(prstat, KERN_PROC_PID, pid, &cnt);
long p_flags = procinfo->ki_flag;
int p_traced = p_flags & P_TRACED;
if (p_traced != P_TRACED) {
mode = PROC_TRACE_CTL_DISABLE;
procctl(P_PID, getpid(), PROC_TRACE_CTL, &mode);
}
procstat_freeprocs(prstat,procinfo);
procstat_close(prstat);
```
But as wayland is [far] in the future on FreeBSD, and that check above is a bit lengthy, I think it is enough if we add it once it is needed.
Reviewers: rakuco, graesslin
Reviewed By: graesslin
Subscribers: plasma-devel
Projects: #plasma
Differential Revision: https://phabricator.kde.org/D1425
2016-05-10 09:49:58 +03:00
|
|
|
check_include_file("sys/procctl.h" HAVE_SYS_PROCCTL_H)
|
|
|
|
check_symbol_exists(PROC_TRACE_CTL "sys/procctl.h" HAVE_PROC_TRACE_CTL)
|
|
|
|
if (HAVE_PR_SET_DUMPABLE OR HAVE_PROC_TRACE_CTL)
|
|
|
|
set(CAN_DISABLE_PTRACE TRUE)
|
|
|
|
endif()
|
|
|
|
add_feature_info("prctl/procctl tracing control"
|
|
|
|
CAN_DISABLE_PTRACE
|
|
|
|
"Required for disallowing ptrace on kwin_wayland process")
|
2015-12-08 13:42:48 +03:00
|
|
|
|
2017-07-31 18:34:37 +03:00
|
|
|
check_include_file("sys/sysmacros.h" HAVE_SYS_SYSMACROS_H)
|
2008-01-03 18:22:19 +03:00
|
|
|
|
2017-07-23 13:02:58 +03:00
|
|
|
check_include_file("linux/vt.h" HAVE_LINUX_VT_H)
|
|
|
|
add_feature_info("linux/vt.h"
|
|
|
|
HAVE_LINUX_VT_H
|
|
|
|
"Required for virtual terminal support under wayland")
|
|
|
|
check_include_file("linux/fb.h" HAVE_LINUX_FB_H)
|
|
|
|
add_feature_info("linux/fb.h"
|
|
|
|
HAVE_LINUX_FB_H
|
|
|
|
"Required for the fbdev backend")
|
2008-01-03 18:22:19 +03:00
|
|
|
|
2017-09-10 13:05:29 +03: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")
|
|
|
|
|
2020-07-22 20:29:23 +03:00
|
|
|
|
|
|
|
pkg_check_modules(PipeWire IMPORTED_TARGET libpipewire-0.3)
|
|
|
|
add_feature_info(PipeWire PipeWire_FOUND "Required for Wayland screencasting")
|
|
|
|
|
2008-01-03 18:22:19 +03:00
|
|
|
########### global ###############
|
2007-04-29 21:35:43 +04:00
|
|
|
|
2011-08-11 20:03:01 +04:00
|
|
|
include_directories(BEFORE
|
2021-02-09 22:31:40 +03:00
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/src/libkwineffects
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/src
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/src/libkwineffects
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/src/effects
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/src/tabbox
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/src/platformsupport
|
2019-09-17 12:15:35 +03:00
|
|
|
)
|
2007-04-29 21:35:43 +04:00
|
|
|
|
2021-02-09 22:31:40 +03:00
|
|
|
if (KF5DocTools_FOUND)
|
|
|
|
add_subdirectory(doc)
|
2013-02-25 14:14:56 +04:00
|
|
|
endif()
|
2011-04-28 18:18:15 +04:00
|
|
|
|
2019-09-17 12:15:35 +03:00
|
|
|
add_subdirectory(data)
|
2021-02-09 22:31:40 +03:00
|
|
|
add_subdirectory(kconf_update)
|
|
|
|
add_subdirectory(src)
|
2014-04-03 12:15:57 +04:00
|
|
|
|
2018-05-27 23:02:58 +03:00
|
|
|
if (BUILD_TESTING)
|
2021-01-06 22:05:37 +03:00
|
|
|
find_package(WaylandProtocols 1.19 REQUIRED)
|
2020-09-01 11:58:46 +03:00
|
|
|
find_package(QtWaylandScanner ${QT_MIN_VERSION} REQUIRED)
|
|
|
|
find_package(Wayland REQUIRED COMPONENTS Client)
|
|
|
|
|
2018-05-27 23:02:58 +03:00
|
|
|
add_subdirectory(autotests)
|
|
|
|
add_subdirectory(tests)
|
|
|
|
endif()
|
|
|
|
|
2019-11-05 02:44:34 +03: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})
|
|
|
|
|
2015-03-23 00:25:38 +03:00
|
|
|
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
|
|
|
|
|
2017-09-12 19:14:03 +03:00
|
|
|
include(CMakePackageConfigHelpers)
|
2021-02-08 22:19:33 +03:00
|
|
|
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KWinDBusInterface")
|
2017-09-12 19:14:03 +03:00
|
|
|
configure_package_config_file(KWinDBusInterfaceConfig.cmake.in
|
2014-03-27 15:31:25 +04:00
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/KWinDBusInterfaceConfig.cmake"
|
2015-10-28 20:15:36 +03:00
|
|
|
PATH_VARS KDE_INSTALL_DBUSINTERFACEDIR
|
2014-03-27 15:31:25 +04:00
|
|
|
INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR})
|
2014-03-21 19:07:55 +04:00
|
|
|
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/KWinDBusInterfaceConfig.cmake
|
|
|
|
DESTINATION ${CMAKECONFIG_INSTALL_DIR})
|
2020-02-17 17:42:01 +03:00
|
|
|
|
2021-01-27 13:56:43 +03:00
|
|
|
|
|
|
|
# plasma-kwin_wayland.service.in is currently disabled as plasma-workspace currently launches
|
|
|
|
# kwin-wayland explicitly. Porting this is currently blocked on propogating DISPLAY
|
|
|
|
ecm_install_configured_files(INPUT plasma-kwin_x11.service.in @ONLY
|
2020-02-17 17:42:01 +03:00
|
|
|
DESTINATION ${SYSTEMD_USER_UNIT_INSTALL_DIR})
|