diff --git a/CMakeLists.txt b/CMakeLists.txt index fbdd95433..64e8bbd60 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,193 +1,197 @@ cmake_minimum_required(VERSION 3.0) project(plasma-desktop) set(PROJECT_VERSION "5.18.80") set(PROJECT_VERSION_MAJOR 5) set(QT_MIN_VERSION "5.12.0") set(KF5_MIN_VERSION "5.69.0") find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE) set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules) include(KDEInstallDirs) include(KDECMakeSettings) include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE) include(ECMInstallIcons) include(ECMMarkAsTest) include(ECMMarkNonGuiExecutable) include(ECMOptionalAddSubdirectory) include(ECMQtDeclareLoggingCategory) include(FeatureSummary) include(CheckIncludeFiles) include(KDEClangFormat) find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS Quick QuickWidgets DBus Widgets X11Extras Svg Concurrent ) find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS Auth Plasma PlasmaQuick DocTools I18n KCMUtils NewStuff NewStuffQuick KDELibs4Support Notifications NotifyConfig Attica Wallet Runner GlobalAccel Declarative DBusAddons Activities ActivitiesStats Config WidgetsAddons ) find_package(KF5Kirigami2 ${KF5_MIN_VERSION} CONFIG) set_package_properties(KF5Kirigami2 PROPERTIES DESCRIPTION "A QtQuick based components set" PURPOSE "Required at runtime by many KCMs" TYPE RUNTIME ) find_package(KF5QQC2DesktopStyle ${KF5_MIN_VERSION} CONFIG) set_package_properties(KF5QQC2DesktopStyle PROPERTIES DESCRIPTION "QtQuickControls 2 style that uses QWidget's QStyle for painting" PURPOSE "Required at runtime by many KCMs" TYPE RUNTIME ) find_package(LibKWorkspace ${PROJECT_VERSION} CONFIG REQUIRED) find_package(LibNotificationManager ${PROJECT_VERSION} CONFIG REQUIRED) find_package(LibTaskManager ${PROJECT_VERSION} CONFIG REQUIRED) find_package(LibColorCorrect ${PROJECT_VERSION} CONFIG REQUIRED) find_package(KWinDBusInterface CONFIG REQUIRED) find_package(ScreenSaverDBusInterface CONFIG REQUIRED) find_package(KRunnerAppDBusInterface CONFIG REQUIRED) find_package(KSMServerDBusInterface CONFIG REQUIRED) find_package(KF5ItemModels CONFIG REQUIRED) find_package(KF5Emoticons CONFIG REQUIRED) find_package(KF5 REQUIRED COMPONENTS SysGuard) find_package(KDED CONFIG REQUIRED) find_package(KF5Baloo ${KF5_MIN_VERSION}) set_package_properties(KF5Baloo PROPERTIES DESCRIPTION "File Searching" TYPE RECOMMENDED PURPOSE "Needed to build the File Search KCM" ) find_package(Fontconfig) set_package_properties(Fontconfig PROPERTIES DESCRIPTION "Font access configuration library" URL "https://www.freedesktop.org/wiki/Software/fontconfig" TYPE OPTIONAL PURPOSE "Needed to build font configuration and installation tools" ) find_package(X11) set_package_properties(X11 PROPERTIES DESCRIPTION "X11 libraries" URL "https://www.x.org" TYPE REQUIRED PURPOSE "Required for building the X11 based workspace" ) if(X11_FOUND) set(HAVE_X11 1) endif() find_package(UDev) set_package_properties(UDev PROPERTIES DESCRIPTION "UDev library" URL "https://www.freedesktop.org/wiki/Software/systemd/" TYPE OPTIONAL PURPOSE "Required for device discovery in keyboard daemon" ) find_package(XCB REQUIRED COMPONENTS XCB SHM IMAGE OPTIONAL_COMPONENTS XKB XINPUT ) set_package_properties(XCB PROPERTIES TYPE REQUIRED) add_feature_info("XCB-XKB" XCB_XKB_FOUND "Required for building kcm/keyboard") add_feature_info("libxft" X11_Xft_FOUND "X FreeType interface library required for font installation") find_package(Evdev) set_package_properties(Evdev PROPERTIES TYPE OPTIONAL) add_feature_info("Evdev" EVDEV_FOUND "Evdev driver headers needed for mouse KCM") find_package(Synaptics) set_package_properties(Synaptics PROPERTIES TYPE OPTIONAL) add_feature_info("Synaptics" SYNAPTICS_FOUND "Synaptics libraries needed for touchpad KCM") +find_package(XorgServer) +set_package_properties(XorgServer PROPERTIES TYPE OPTIONAL) +add_feature_info("XorgServer" XORGSERVER_FOUND "XServer header needed for touchpad KCM (X11 backend)") + find_package(XorgLibinput) set_package_properties(XorgLibinput PROPERTIES TYPE OPTIONAL) add_feature_info("XorgLibinput" XORGLIBINPUT_FOUND "Libinput driver headers needed for mouse and touchpad KCM") if(XORGLIBINPUT_FOUND) set(HAVE_XORGLIBINPUT 1) endif() include(ConfigureChecks.cmake) find_package(Breeze ${PROJECT_VERSION} CONFIG) set_package_properties(Breeze PROPERTIES TYPE OPTIONAL PURPOSE "For setting the default window decoration plugin") if(${Breeze_FOUND}) if(${BREEZE_WITH_KDECORATION}) set(HAVE_BREEZE_DECO true) else() set(HAVE_BREEZE_DECO FALSE) endif() else() set(HAVE_BREEZE_DECO FALSE) endif() include_directories("${CMAKE_CURRENT_BINARY_DIR}") configure_file(config-workspace.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-workspace.h) configure_file(config-unix.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-unix.h ) configure_file(config-X11.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-X11.h) configure_file(config-runtime.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-runtime.h) plasma_install_package(desktoppackage org.kde.plasma.desktop shells shell) add_definitions(-DQT_NO_URL_CAST_FROM_STRING) add_subdirectory(layout-templates) add_subdirectory(doc) add_subdirectory(runners) add_subdirectory(containments) add_subdirectory(toolboxes) add_subdirectory(applets) add_subdirectory(dataengines) add_subdirectory(kcms) add_subdirectory(knetattach) add_subdirectory(attica-kde) add_subdirectory(imports/activitymanager/) add_subdirectory(solid-device-automounter) if(X11_Xkb_FOUND AND XCB_XKB_FOUND) add_subdirectory(kaccess) endif() install(FILES org.kde.plasmashell.metainfo.xml DESTINATION ${KDE_INSTALL_METAINFODIR}) # 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}) feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES) diff --git a/cmake/modules/FindXorgServer.cmake b/cmake/modules/FindXorgServer.cmake new file mode 100644 index 000000000..5248c6d25 --- /dev/null +++ b/cmake/modules/FindXorgServer.cmake @@ -0,0 +1,45 @@ +# - Find xorg-server's headers. +# This module defines the following variables: +# +# XORGSERVER_FOUND - true if xserver was found +# XORGSERVER_INCLUDE_DIRS - include path for xserver +# There are no libraries, just a header file +# +# Copyright (c) 2020 Andreas Sturmlechner +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. Neither the name of the University nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. + +find_package(PkgConfig) +pkg_check_modules(PC_XORGSERVER xorg-server) + +find_path(XORGSERVER_INCLUDE_DIRS + NAMES xserver-properties.h + HINTS ${PC_XORGSERVER_INCLUDE_DIRS} ${PC_XORGSERVER_INCLUDEDIR} +) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(XORGSERVER REQUIRED_VARS XORGSERVER_INCLUDE_DIRS) + +mark_as_advanced(XORGSERVER_INCLUDE_DIRS) diff --git a/kcms/CMakeLists.txt b/kcms/CMakeLists.txt index 7ab966e8e..ce730f537 100644 --- a/kcms/CMakeLists.txt +++ b/kcms/CMakeLists.txt @@ -1,68 +1,68 @@ remove_definitions(-DQT_NO_CAST_FROM_ASCII -DQT_STRICT_ITERATORS -DQT_NO_CAST_FROM_BYTEARRAY -DQT_NO_KEYWORDS) find_package(Freetype) set_package_properties(Freetype PROPERTIES DESCRIPTION "A font rendering engine" URL "https://www.freetype.org" TYPE OPTIONAL PURPOSE "Needed to build kfontinst, a simple font installer." ) set(libkxftconfig_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/fonts/kxftconfig.cpp ) if(X11_Xkb_FOUND AND XCB_XKB_FOUND) add_subdirectory( keyboard ) endif() if (EVDEV_FOUND AND XORGLIBINPUT_FOUND AND X11_Xinput_FOUND) add_subdirectory( mouse ) endif() add_subdirectory( access ) add_subdirectory( dateandtime ) add_subdirectory( autostart ) add_subdirectory( ksplash ) add_subdirectory( launch ) add_subdirectory( colors ) add_subdirectory( krdb ) add_subdirectory( style ) add_subdirectory( desktoptheme ) add_subdirectory( standard_actions ) add_subdirectory( keys ) add_subdirectory( ksmserver ) add_subdirectory( lookandfeel ) add_subdirectory( nightcolor ) add_subdirectory( hardware ) add_subdirectory( desktoppaths ) add_subdirectory(activities) add_subdirectory(componentchooser) add_subdirectory(emoticons) add_subdirectory(icons) add_subdirectory(kded) add_subdirectory(formats) add_subdirectory(notifications) add_subdirectory(runners) add_subdirectory(spellchecking) add_subdirectory(qtquicksettings) add_subdirectory(workspaceoptions) if (KF5Baloo_FOUND) add_subdirectory(baloo) endif() add_subdirectory(solid_actions) if(X11_Xcursor_FOUND) add_subdirectory(cursortheme) endif() -if (SYNAPTICS_FOUND AND X11_Xinput_FOUND) +if (XORGSERVER_FOUND AND SYNAPTICS_FOUND AND X11_Xinput_FOUND) add_subdirectory(touchpad) endif() if(FONTCONFIG_FOUND AND FREETYPE_FOUND) add_subdirectory( kfontinst ) add_subdirectory( fonts ) endif() diff --git a/kcms/touchpad/backends/x11.cmake b/kcms/touchpad/backends/x11.cmake index 9248eff7c..8a584e939 100644 --- a/kcms/touchpad/backends/x11.cmake +++ b/kcms/touchpad/backends/x11.cmake @@ -1,55 +1,55 @@ # // krazy:excludeall=copyright,license find_package(X11 REQUIRED) find_package(X11_XCB REQUIRED) find_package(XCB REQUIRED COMPONENTS ATOM RECORD) find_package(PkgConfig REQUIRED) if(NOT X11_Xinput_FOUND) message(FATAL_ERROR "Xinput not found") endif() include_directories(${X11_Xinput_INCLUDE_PATH} ${X11_X11_INCLUDE_PATH} ${Synaptics_INCLUDE_DIRS} - ${XORG_INCLUDE_DIRS} + ${XORGSERVER_INCLUDE_DIRS} ) SET(backend_SRCS ${backend_SRCS} backends/x11/propertyinfo.cpp backends/x11/xlibbackend.cpp backends/x11/synapticstouchpad.cpp backends/x11/xlibtouchpad.cpp backends/x11/xcbatom.cpp backends/x11/xlibnotifications.cpp backends/x11/xrecordkeyboardmonitor.cpp ) if (HAVE_XORGLIBINPUT) include_directories(${XORGLIBINPUT_INCLUDE_DIRS}) SET(backend_SRCS ${backend_SRCS} backends/libinputcommon.cpp backends/x11/libinputtouchpad.cpp ) endif() SET(backend_LIBS ${backend_LIBS} XCB::ATOM XCB::RECORD ${X11_X11_LIB} X11::XCB ${X11_Xinput_LIB} ) add_executable(kcm-touchpad-list-devices backends/x11/listdevices.cpp) target_link_libraries(kcm-touchpad-list-devices ${X11_X11_LIB} ${X11_Xinput_LIB} ) install(TARGETS kcm-touchpad-list-devices DESTINATION ${KDE_INSTALL_TARGETS_DEFAULT_ARGS} )