### Install KF6WindowSystemX11Plugin Target Source: https://github.com/kde/kwindowsystem/blob/master/src/platforms/xcb/CMakeLists.txt Installs the KF6WindowSystemX11Plugin library to the specified plugin directory. ```cmake install( TARGETS KF6WindowSystemX11Plugin DESTINATION ${KDE_INSTALL_PLUGINDIR}/kf6/kwindowsystem/ ) ``` -------------------------------- ### Install Wayland Plugin Source: https://github.com/kde/kwindowsystem/blob/master/src/platforms/wayland/CMakeLists.txt Installs the KF6WindowSystemKWaylandPlugin to the specified plugin directory. This makes the plugin available for runtime loading. ```cmake install( TARGETS KF6WindowSystemKWaylandPlugin DESTINATION ${KDE_INSTALL_PLUGINDIR}/kf6/kwindowsystem/ ) ``` -------------------------------- ### Install Generated Headers Source: https://github.com/kde/kwindowsystem/blob/master/src/platforms/xcb/CMakeLists.txt Installs the generated header files and fixx11h.h to the KWindowSystem include directory for development components. ```cmake install( FILES ${KWindowSystemX11_HEADERS} fixx11h.h DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF}/KWindowSystem COMPONENT Devel ) ``` -------------------------------- ### Finalize and Install KWindowSystem QML Module Source: https://github.com/kde/kwindowsystem/blob/master/src/qml/CMakeLists.txt Finalizes the KWindowSystem QML module and installs it to the specified QML directory. This makes the module available for use in QML applications. ```cmake ecm_finalize_qml_module(KWindowSystem DESTINATION ${KDE_INSTALL_QMLDIR}) ``` -------------------------------- ### Specify Source Files for KF6WindowSystemX11Plugin Source: https://github.com/kde/kwindowsystem/blob/master/src/platforms/xcb/CMakeLists.txt Lists the source files to be compiled for the KF6WindowSystemX11Plugin library. ```cmake target_sources(KF6WindowSystemX11Plugin PRIVATE kwindoweffects.cpp kwindowshadow.cpp kwindowsystem.cpp kxutils.cpp plugin.cpp ) ``` -------------------------------- ### Set Target Properties for KF6WindowSystemX11Plugin Source: https://github.com/kde/kwindowsystem/blob/master/src/platforms/xcb/CMakeLists.txt Configures the output directory for the KF6WindowSystemX11Plugin library. ```cmake set_target_properties( KF6WindowSystemX11Plugin PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/kf6/kwindowsystem" ) ``` -------------------------------- ### Add KWindowSystem QML Module Source: https://github.com/kde/kwindowsystem/blob/master/src/qml/CMakeLists.txt Adds the KWindowSystem QML module with its specified URI and version. It also generates plugin source files. ```cmake ecm_add_qml_module(KWindowSystem URI "org.kde.kwindowsystem" VERSION 1.0 GENERATE_PLUGIN_SOURCE) ``` -------------------------------- ### Link Libraries for Wayland Helper Source: https://github.com/kde/kwindowsystem/blob/master/autotests/helper/CMakeLists.txt Links the 'KF6::WindowSystem' library to the Wayland helper executable. ```cmake target_link_libraries(kwindowsystem_platform_wayland_helper KF6::WindowSystem) ``` -------------------------------- ### Define KF6WindowSystemX11Plugin Library Source: https://github.com/kde/kwindowsystem/blob/master/src/platforms/xcb/CMakeLists.txt Defines the KF6WindowSystemX11Plugin as a MODULE library. ```cmake add_library(KF6WindowSystemX11Plugin MODULE) ``` -------------------------------- ### Add Wayland Platform Helper Executable Source: https://github.com/kde/kwindowsystem/blob/master/autotests/helper/CMakeLists.txt Defines the 'kwindowsystem_platform_wayland_helper' executable and its source file. ```cmake add_executable(kwindowsystem_platform_wayland_helper wayland_platform.cpp) ``` -------------------------------- ### Configure X11 Platform Unit Tests Source: https://github.com/kde/kwindowsystem/blob/master/autotests/CMakeLists.txt Configures and adds unit tests specifically for the X11 platform, including various KWindowSystem components. ```cmake if(KWINDOWSYSTEM_X11) include_directories(${CMAKE_SOURCE_DIR}/src/platforms/xcb) kwindowsystem_unit_tests( kmanagerselectiontest kstartupinfo_unittest kxmessages_unittest kkeyserver_x11_unittest ) kwindowsystem_unit_tests( kwindoweffectstest kwindowinfox11test kwindowsystemx11test kwindowsystem_threadtest netrootinfotestwm netwininfotestclient netwininfotestwm compositingenabled_test ) kwindowsystem_executable_tests( fixx11h_test fixx11h_test2 dontcrashmapviewport ) endif() ``` -------------------------------- ### Find Qt6 Components Source: https://github.com/kde/kwindowsystem/blob/master/autotests/CMakeLists.txt Finds the required Qt6 components, including Test, Widgets, and other necessary modules for building. ```cmake find_package(Qt6 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Test Widgets) ``` -------------------------------- ### Link Dependencies for KF6WindowSystemX11Plugin Source: https://github.com/kde/kwindowsystem/blob/master/src/platforms/xcb/CMakeLists.txt Specifies the libraries that KF6WindowSystemX11Plugin depends on, including KF6WindowSystem, XCB libraries, X11 libraries, and Qt6::GuiPrivate. ```cmake target_link_libraries(KF6WindowSystemX11Plugin PRIVATE KF6WindowSystem XCB::XCB XCB::RES ${X11_LIBRARIES} ${X11_Xfixes_LIB} Qt6::GuiPrivate ) ``` -------------------------------- ### Link Libraries for Wayland Plugin Source: https://github.com/kde/kwindowsystem/blob/master/src/platforms/wayland/CMakeLists.txt Specifies the libraries that the KF6WindowSystemKWaylandPlugin needs to link against. This includes KF6WindowSystem, Wayland client libraries, Qt private modules, and XKBCommon. ```cmake target_link_libraries(KF6WindowSystemKWaylandPlugin KF6WindowSystem Wayland::Client Qt::GuiPrivate Qt::WaylandClient PkgConfig::XKBCommon ) ``` -------------------------------- ### Link Qt Gui Private for X11 Source: https://github.com/kde/kwindowsystem/blob/master/tests/CMakeLists.txt Links the Qt6::GuiPrivate library to the 'icontest' executable when KWINDOWSYSTEM_X11 is defined. This is typically for X11-specific functionalities. ```cmake target_link_libraries(icontest Qt6::GuiPrivate) ``` -------------------------------- ### Generate Headers for KWindowSystemX11 Source: https://github.com/kde/kwindowsystem/blob/master/src/platforms/xcb/CMakeLists.txt Generates header files for KWindowSystemX11, specifying required header names. ```cmake ecm_generate_headers(KWindowSystemX11_HEADERS HEADER_NAMES KSelectionOwner KSelectionWatcher KXMessages NETWM # does not match the classnames in that file... REQUIRED_HEADERS KWindowSystemX11_HEADERS ) ``` -------------------------------- ### Link Libraries for KWindowSystem Source: https://github.com/kde/kwindowsystem/blob/master/src/qml/CMakeLists.txt Links the KWindowSystem target against Qt::Qml and KF6::WindowSystem libraries. These are required for QML functionality and window system integration. ```cmake target_link_libraries(KWindowSystem PRIVATE Qt::Qml KF6::WindowSystem) ``` -------------------------------- ### Set Compile Options Source: https://github.com/kde/kwindowsystem/blob/master/src/platforms/wayland/CMakeLists.txt Applies compile-time options to the Wayland plugin. Here, it undefines the QT_NO_KEYWORDS macro. ```cmake target_compile_options(KF6WindowSystemKWaylandPlugin PRIVATE -UQT_NO_KEYWORDS) ``` -------------------------------- ### Add Source Files to Target Source: https://github.com/kde/kwindowsystem/blob/master/src/platforms/wayland/CMakeLists.txt Adds the previously defined source files to the KF6WindowSystemKWaylandPlugin target. This ensures all necessary code is compiled into the plugin. ```cmake target_sources(KF6WindowSystemKWaylandPlugin PRIVATE ${wayland_plugin_SRCS}) ``` -------------------------------- ### Add UI Source for Wayland Test Source: https://github.com/kde/kwindowsystem/blob/master/tests/CMakeLists.txt Adds a UI file as a source for the 'kwaylandextrastest' executable when KWINDOWSYSTEM_WAYLAND is defined. This is specific to Wayland integration tests. ```cmake target_sources(kwaylandextrastest PRIVATE kwaylandextrastest.ui) ``` -------------------------------- ### Define KF6WindowSystemKWaylandPlugin Library Source: https://github.com/kde/kwindowsystem/blob/master/src/platforms/wayland/CMakeLists.txt Defines the KF6WindowSystemKWaylandPlugin as a MODULE library. This is the primary target for the Wayland plugin. ```cmake add_library(KF6WindowSystemKWaylandPlugin MODULE) ``` -------------------------------- ### Define KWindowSystem Unit Test Macro Source: https://github.com/kde/kwindowsystem/blob/master/autotests/CMakeLists.txt A CMake macro to define unit tests for KWindowSystem, linking necessary libraries including XCB components if X11 is enabled. ```cmake macro(KWINDOWSYSTEM_UNIT_TESTS) foreach(_testname ${ARGN}) set(libs KF6::WindowSystem Qt6::Test Qt6::Widgets Qt6::GuiPrivate) if (KWINDOWSYSTEM_X11) list(APPEND libs XCB::XCB XCB::KEYSYMS XCB::ICCCM) endif() ecm_add_test(${_testname}.cpp LINK_LIBRARIES ${libs} GUI) endforeach(_testname) endmacro(KWINDOWSYSTEM_UNIT_TESTS) ``` -------------------------------- ### Generate Wayland Protocol Client Sources Source: https://github.com/kde/kwindowsystem/blob/master/src/platforms/wayland/CMakeLists.txt Generates client-side C++ sources from Wayland protocol XML files. This enables the plugin to interact with Wayland protocols like xdg-shell and others. ```cmake qt6_generate_wayland_protocol_client_sources(KF6WindowSystemKWaylandPlugin PRIVATE_CODE FILES ${WaylandProtocols_DATADIR}/stable/xdg-shell/xdg-shell.xml ${WaylandProtocols_DATADIR}/staging/ext-background-effect/ext-background-effect-v1.xml ${WaylandProtocols_DATADIR}/staging/xdg-activation/xdg-activation-v1.xml ${WaylandProtocols_DATADIR}/staging/xdg-dialog/xdg-dialog-v1.xml ${WaylandProtocols_DATADIR}/staging/xdg-toplevel-tag/xdg-toplevel-tag-v1.xml ${WaylandProtocols_DATADIR}/unstable/xdg-foreign/xdg-foreign-unstable-v2.xml ${PLASMA_WAYLAND_PROTOCOLS_DIR}/blur.xml ${PLASMA_WAYLAND_PROTOCOLS_DIR}/contrast.xml ${PLASMA_WAYLAND_PROTOCOLS_DIR}/slide.xml ${PLASMA_WAYLAND_PROTOCOLS_DIR}/plasma-window-management.xml ${PLASMA_WAYLAND_PROTOCOLS_DIR}/shadow.xml ${Wayland_DATADIR}/wayland.xml ) ``` -------------------------------- ### Declare Wayland Plugin Logging Category Source: https://github.com/kde/kwindowsystem/blob/master/src/platforms/wayland/CMakeLists.txt Sets up a Qt logging category for the Wayland plugin. This allows for structured logging with a specific identifier and category name. ```cmake ecm_qt_declare_logging_category(wayland_plugin_SRCS HEADER logging.h IDENTIFIER KWAYLAND_KWS CATEGORY_NAME kf.windowsystem.wayland OLD_CATEGORY_NAMES org.kde.kf5.kwindowsystem.kwayland DESCRIPTION "KWindowSystem Wayland Plugin" EXPORT KWINDOWSYSTEM ) ``` -------------------------------- ### Mark Wayland Helper as Test Target Source: https://github.com/kde/kwindowsystem/blob/master/autotests/helper/CMakeLists.txt Marks the 'kwindowsystem_platform_wayland_helper' executable as a test target using ECM. ```cmake ecm_mark_as_test(kwindowsystem_platform_wayland_helper) ``` -------------------------------- ### Add Subdirectory for Helper Source: https://github.com/kde/kwindowsystem/blob/master/autotests/CMakeLists.txt Includes a subdirectory named 'helper', likely containing shared build logic or source files. ```cmake add_subdirectory(helper) ``` -------------------------------- ### Specify Source Files for Wayland Plugin Source: https://github.com/kde/kwindowsystem/blob/master/src/platforms/wayland/CMakeLists.txt Lists all source and header files required for the Wayland plugin. These files are used to build the plugin library. ```cmake set(wayland_plugin_SRCS plugin.cpp shm.cpp windoweffects.cpp windowshadow.cpp windowsystem.cpp waylandxdgactivationv1.cpp waylandxdgdialogv1.cpp waylandxdgforeignv2.cpp waylandxdgtopleveltagv1.cpp plugin.h windoweffects.h windowshadow.h windowsystem.h waylandxdgactivationv1_p.h ) ``` -------------------------------- ### Define Executable Tests Source: https://github.com/kde/kwindowsystem/blob/master/tests/CMakeLists.txt Defines a macro to create executable test targets. It adds C++ sources and links necessary Qt and KF6 libraries. ```cmake macro(kwindowsystem_executable_tests) foreach(_testname ${ARGN}) add_executable(${_testname} ${_testname}.cpp) target_link_libraries(${_testname} Qt6::Test Qt6::Widgets KF6::WindowSystem) ecm_mark_as_test(${_testname}) endforeach(_testname) endmacro() ``` -------------------------------- ### Add Wayland Platform Test Source: https://github.com/kde/kwindowsystem/blob/master/autotests/CMakeLists.txt Defines a unit test for the Wayland platform, linking against KWindowSystem and Qt Test libraries. ```cmake ecm_add_test(kwindowsystem_platform_wayland_test.cpp LINK_LIBRARIES KF6::WindowSystem Qt6::Test TEST_NAME kwindowsystemplatformwaylandtest GUI ) ``` -------------------------------- ### Define KWindowSystem Executable Test Macro Source: https://github.com/kde/kwindowsystem/blob/master/autotests/CMakeLists.txt A CMake macro to define executable tests for KWindowSystem, linking against core KWindowSystem and Qt libraries. ```cmake macro(KWINDOWSYSTEM_EXECUTABLE_TESTS) foreach(_testname ${ARGN}) add_executable(${_testname} ${_testname}.cpp) target_link_libraries(${_testname} KF6::WindowSystem Qt6::Test XCB::XCB Qt6::GuiPrivate) ecm_mark_as_test(${_testname}) endforeach() endmacro() ``` -------------------------------- ### Include ECM Modules Source: https://github.com/kde/kwindowsystem/blob/master/autotests/CMakeLists.txt Includes necessary KDE Extra Modules (ECM) for testing and build system integration. ```cmake include(ECMMarkAsTest) include(ECMAddTests) ``` -------------------------------- ### Specify Private Source Files Source: https://github.com/kde/kwindowsystem/blob/master/src/qml/CMakeLists.txt Adds 'types.h' as a private source file to the KWindowSystem target. ```cmake target_sources(KWindowSystem PRIVATE types.h) ``` -------------------------------- ### Define Build Directory for Autotests Source: https://github.com/kde/kwindowsystem/blob/master/autotests/CMakeLists.txt Adds a definition for the autotest build directory, useful for build system configurations. ```cmake add_definitions(-DAUTOTEST_BUILD_DIR="${CMAKE_CURRENT_BINARY_DIR}") ``` -------------------------------- ### Check for XKBCommon Dependency Source: https://github.com/kde/kwindowsystem/blob/master/src/platforms/wayland/CMakeLists.txt Checks if the xkbcommon library is available and imports its target. This is a required dependency for the plugin. ```cmake pkg_check_modules(XKBCommon REQUIRED IMPORTED_TARGET xkbcommon) ``` -------------------------------- ### Add Dependencies for Wayland Helper Source: https://github.com/kde/kwindowsystem/blob/master/autotests/helper/CMakeLists.txt Specifies that the Wayland helper executable depends on the 'kwindowsystemplatformwaylandtest' target. ```cmake add_dependencies(kwindowsystem_platform_wayland_helper kwindowsystemplatformwaylandtest) ``` -------------------------------- ### Set Test Name Prefix Source: https://github.com/kde/kwindowsystem/blob/master/autotests/CMakeLists.txt Sets a prefix for all test names generated by ECM, ensuring consistent naming. ```cmake set(ECM_TEST_NAME_PREFIX "kwindowsystem-") ``` -------------------------------- ### Conditional Subdirectory Inclusion in CMake Source: https://github.com/kde/kwindowsystem/blob/master/src/platforms/CMakeLists.txt Includes platform-specific subdirectories (xcb for X11, wayland for Wayland) only if the corresponding build feature is enabled. This is a common pattern for managing platform-dependent code in CMake projects. ```cmake if(KWINDOWSYSTEM_X11) add_subdirectory(xcb) endif() if(KWINDOWSYSTEM_WAYLAND) add_subdirectory(wayland) endif() ``` -------------------------------- ### Conditional Compilation for memfd Source: https://github.com/kde/kwindowsystem/blob/master/src/platforms/wayland/CMakeLists.txt Adds the HAVE_MEMFD compile definition if the HAVE_MEMFD feature is enabled. This is used for platform-specific features. ```cmake if(HAVE_MEMFD) target_compile_definitions(KF6WindowSystemKWaylandPlugin PRIVATE -DHAVE_MEMFD) endif() ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.