dot
vizie's NixOS desktop: Hyprland, CachyOS kernel and gaming tweaks
| 1 | # Standalone build of plasma-workspace's xembed-sni-proxy. Replaces the upstream |
| 2 | # CMakeLists.txt in that directory so it builds without the rest of |
| 3 | # plasma-workspace (or extra-cmake-modules, which upstream uses to find XCB and |
| 4 | # to generate debug.h). |
| 5 | cmake_minimum_required(VERSION 3.16) |
| 6 | project(xembedsniproxy LANGUAGES CXX) |
| 7 | |
| 8 | set(WORKSPACE_VERSION "0" CACHE STRING "plasma-workspace version being built") |
| 9 | |
| 10 | set(CMAKE_CXX_STANDARD 20) |
| 11 | set(CMAKE_CXX_STANDARD_REQUIRED ON) |
| 12 | set(CMAKE_AUTOMOC ON) |
| 13 | set(CMAKE_INCLUDE_CURRENT_DIR ON) |
| 14 | |
| 15 | find_package(Qt6 REQUIRED COMPONENTS Core Gui DBus) |
| 16 | find_package(KF6CoreAddons REQUIRED) |
| 17 | find_package(KF6Crash REQUIRED) |
| 18 | find_package(KF6DBusAddons REQUIRED) |
| 19 | find_package(KF6WindowSystem REQUIRED) |
| 20 | find_package(X11 REQUIRED) |
| 21 | find_package(PkgConfig REQUIRED) |
| 22 | pkg_check_modules(XCB REQUIRED IMPORTED_TARGET |
| 23 | xcb xcb-xfixes xcb-damage xcb-composite xcb-randr xcb-shape xcb-shm xcb-util xcb-image |
| 24 | xcb-icccm) |
| 25 | |
| 26 | # Stand-ins for the headers the full plasma-workspace build generates. |
| 27 | file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/config-workspace.h |
| 28 | "#define WORKSPACE_VERSION_STRING \"${WORKSPACE_VERSION}\"\n") |
| 29 | file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/debug.h |
| 30 | "#pragma once\n#include <QLoggingCategory>\nQ_DECLARE_LOGGING_CATEGORY(SNIPROXY)\n") |
| 31 | file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/debug.cpp |
| 32 | "#include \"debug.h\"\nQ_LOGGING_CATEGORY(SNIPROXY, \"kde.xembedsniproxy\", QtInfoMsg)\n") |
| 33 | |
| 34 | set(XEMBED_SNI_PROXY_SOURCES |
| 35 | main.cpp |
| 36 | fdoselectionmanager.cpp fdoselectionmanager.h |
| 37 | snidbus.cpp snidbus.h |
| 38 | sniproxy.cpp |
| 39 | xtestsender.cpp xtestsender.h |
| 40 | ${CMAKE_CURRENT_BINARY_DIR}/debug.cpp |
| 41 | ) |
| 42 | |
| 43 | qt_add_dbus_adaptor(XEMBED_SNI_PROXY_SOURCES org.kde.StatusNotifierItem.xml |
| 44 | sniproxy.h SNIProxy) |
| 45 | qt_add_dbus_interface(XEMBED_SNI_PROXY_SOURCES org.kde.StatusNotifierWatcher.xml |
| 46 | statusnotifierwatcher_interface) |
| 47 | |
| 48 | add_executable(xembedsniproxy ${XEMBED_SNI_PROXY_SOURCES}) |
| 49 | |
| 50 | target_link_libraries(xembedsniproxy |
| 51 | Qt6::Core |
| 52 | Qt6::Gui |
| 53 | Qt6::DBus |
| 54 | KF6::DBusAddons |
| 55 | KF6::WindowSystem |
| 56 | KF6::CoreAddons |
| 57 | KF6::Crash |
| 58 | PkgConfig::XCB |
| 59 | X11::Xtst |
| 60 | ) |
| 61 | |
| 62 | install(TARGETS xembedsniproxy RUNTIME DESTINATION bin) |