### Install Desktop Entry and Icon Source: https://github.com/quickshell-mirror/quickshell/blob/master/CMakeLists.txt Installs the application's desktop entry file and SVG icon to their respective standard installation directories. ```cmake install( FILES ${CMAKE_SOURCE_DIR}/assets/org.quickshell.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications ) install( FILES ${CMAKE_SOURCE_DIR}/assets/quickshell.svg DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/scalable/apps RENAME org.quickshell.svg ) ``` -------------------------------- ### Install Project Executable Symlink Source: https://github.com/quickshell-mirror/quickshell/blob/master/CMakeLists.txt Installs a symbolic link for the 'quickshell' executable in the installation's binary directory, pointing to the actual executable. ```cmake install(CODE " execute_process( COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_INSTALL_FULL_BINDIR}/quickshell \$ENV{DESTDIR}${CMAKE_INSTALL_FULL_BINDIR}/qs ) ") ``` -------------------------------- ### Install QML Module Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/window/CMakeLists.txt Installs the configured QML module for the 'quickshell-window'. ```cmake install_qml_module(quickshell-window) ``` -------------------------------- ### Install QML Module Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/io/CMakeLists.txt Installs the 'quickshell-io' QML module. ```cmake install_qml_module(quickshell-io) ``` -------------------------------- ### Install QML Module Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/services/greetd/CMakeLists.txt Installs the configured QML module for the greetd service. ```cmake install_qml_module(quickshell-service-greetd) ``` -------------------------------- ### Install QML Module Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/windowmanager/CMakeLists.txt Installs the configured QML module. ```cmake install_qml_module(quickshell-windowmanager) ``` -------------------------------- ### Install QML Module Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/x11/i3/ipc/CMakeLists.txt Installs the 'quickshell-i3-ipc' QML module. ```cmake install_qml_module(quickshell-i3-ipc) ``` -------------------------------- ### Install Executable Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/CMakeLists.txt Installs the built executable to the specified runtime directory. ```cmake install(TARGETS quickshell RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) ``` -------------------------------- ### Install QML Module Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/services/pipewire/CMakeLists.txt Installs the configured QML module for the PipeWire service. ```cmake install_qml_module(quickshell-service-pipewire) ``` -------------------------------- ### Basic CMake Project Setup Source: https://github.com/quickshell-mirror/quickshell/blob/master/CMakeLists.txt Sets the minimum CMake version and project details including version and languages. ```cmake cmake_minimum_required(VERSION 3.20) project(quickshell VERSION "0.3.0" LANGUAGES CXX C) ``` -------------------------------- ### Install QML Module Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/widgets/CMakeLists.txt Installs the configured QML module for the 'quickshell-widgets' target. ```cmake install_qml_module(quickshell-widgets) ``` -------------------------------- ### Install Project with CMake Source: https://github.com/quickshell-mirror/quickshell/blob/master/BUILD.md Install the built project using CMake. This command copies the compiled binaries and associated files to their designated installation locations, as defined by the build configuration. ```sh cmake --install build ``` -------------------------------- ### Install QML Module Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/x11/i3/CMakeLists.txt Installs the configured QML module for 'quickshell-i3'. This makes the module accessible at runtime. ```cmake install_qml_module(quickshell-i3) ``` -------------------------------- ### Install Polkit Service QML Module Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/services/polkit/CMakeLists.txt Installs the configured QML module for the Polkit service. This makes the QML components available for use. ```cmake install_qml_module(quickshell-service-polkit) ``` -------------------------------- ### Install QML Module Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/dbus/dbusmenu/CMakeLists.txt Installs the QML module to the appropriate location for runtime use. ```cmake install_qml_module(quickshell-dbusmenu) ``` -------------------------------- ### Install QML Module Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/wayland/hyprland/global_shortcuts/CMakeLists.txt Installs the configured QML module for the Hyprland global shortcuts. ```cmake install_qml_module(quickshell-hyprland-global-shortcuts) ``` -------------------------------- ### Install QML Module Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/wayland/background_effect/CMakeLists.txt Installs the configured QML module for the Wayland background effect. ```cmake install_qml_module(quickshell-wayland-background-effect) ``` -------------------------------- ### Install QML Module Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/wayland/idle_inhibit/CMakeLists.txt Installs the configured QML module for the Wayland idle inhibitor. ```cmake install_qml_module(quickshell-wayland-idle-inhibit) ``` -------------------------------- ### Install QML Module Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/wayland/idle_notify/CMakeLists.txt Installs the configured QML module for the Wayland idle notification. ```cmake install_qml_module(quickshell-wayland-idle-notify) ``` -------------------------------- ### Install QML Module Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/wayland/shortcuts_inhibit/CMakeLists.txt Installs the configured QML module for Wayland shortcuts inhibition. ```cmake install_qml_module(quickshell-wayland-shortcuts-inhibit) ``` -------------------------------- ### Install QML Module Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/wayland/hyprland/focus_grab/CMakeLists.txt Installs the configured QML module for the Hyprland focus grab functionality. ```cmake install_qml_module(quickshell-hyprland-focus-grab) ``` -------------------------------- ### Install QML Module Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/wayland/toplevel/CMakeLists.txt Installs the configured QML module for Wayland toplevel management. ```cmake install_qml_module(quickshell-wayland-toplevel-management) ``` -------------------------------- ### Install QML Module Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/wayland/wlr_layershell/CMakeLists.txt Installs the configured QML module for the Wayland layer shell. ```cmake install_qml_module(quickshell-wayland-layershell) ``` -------------------------------- ### Install QML Module Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/x11/CMakeLists.txt Installs the registered QML module. This makes the X11 QML components available for use in the application. ```cmake install_qml_module(quickshell-x11) ``` -------------------------------- ### Install QML module Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/core/CMakeLists.txt Installs the quickshell-core QML module to the appropriate location for use by QML applications. ```cmake install_qml_module(quickshell-core) ``` -------------------------------- ### Set QML Directory Path Source: https://github.com/quickshell-mirror/quickshell/blob/master/BUILD.md Use `-DINSTALL_QMLDIR` to specify the direct installation directory for QML modules. ```bash -DINSTALL_QMLDIR="/full/path/to/qml" ``` -------------------------------- ### Install QML Module Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/wayland/hyprland/CMakeLists.txt Installs the configured Hyprland QML module. This makes the module accessible for use in applications. ```cmake install_qml_module(quickshell-hyprland) ``` -------------------------------- ### Set QML Module Installation Path Source: https://github.com/quickshell-mirror/quickshell/blob/master/BUILD.md Use `-DINSTALL_QML_PREFIX` to specify the installation path for QML modules, which prepends the `CMAKE_INSTALL_PREFIX`. ```bash -DINSTALL_QML_PREFIX="path/to/qml" ``` -------------------------------- ### Including CMake Utility Scripts Source: https://github.com/quickshell-mirror/quickshell/blob/master/CMakeLists.txt Includes external CMake scripts for installing QML modules and general utilities. ```cmake include(cmake/install-qml-module.cmake) include(cmake/util.cmake) ``` -------------------------------- ### Add X11 Initialization Object Library Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/x11/CMakeLists.txt Creates an object library for X11 initialization code. This is typically used for setup routines that need to run before the main application logic. ```cmake add_library(quickshell-x11-init OBJECT init.cpp) ``` -------------------------------- ### Define Polkit Service Static Library Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/services/polkit/CMakeLists.txt Creates a static library named 'quickshell-service-polkit' and lists its source files. This library encapsulates the Polkit service logic. ```cmake qt_add_library(quickshell-service-polkit STATIC agentimpl.cpp flow.cpp identity.cpp listener.cpp session.cpp qml.cpp ) ``` -------------------------------- ### Create Object Library for Initialization Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/window/CMakeLists.txt Creates an object library named 'quickshell-window-init' using 'init.cpp' for initialization purposes. ```cmake add_library(quickshell-window-init OBJECT init.cpp) ``` -------------------------------- ### Add Static Library for Greetd Service Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/services/greetd/CMakeLists.txt Defines a static library named 'quickshell-service-greetd' and lists its source files. ```cmake qt_add_library(quickshell-service-greetd STATIC qml.cpp connection.cpp ) ``` -------------------------------- ### Instantiate Process Test Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/io/test/CMakeLists.txt Uses the qs_test function to define the 'process' test executable, compiling 'process.cpp' and including multiple source files like '../datastream.cpp' and '../processcore.cpp'. ```cmake qs_test(process process.cpp ../process.cpp ../datastream.cpp ../processcore.cpp) ``` -------------------------------- ### Create Object Library for Wayland Initialization Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/wayland/windowmanager/CMakeLists.txt Creates an object library for Wayland initialization, linking it with QtQuick. ```cmake add_library(quickshell-wayland-windowsystem-init OBJECT init.cpp) target_link_libraries(quickshell-wayland-windowsystem-init PRIVATE Qt::Quick) ``` -------------------------------- ### Link Main Application Dependencies Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/window/CMakeLists.txt Links the main 'quickshell' target against the 'quickshell-windowplugin' and 'quickshell-window-init' targets. ```cmake target_link_libraries(quickshell PRIVATE quickshell-windowplugin quickshell-window-init) ``` -------------------------------- ### Configure Precompiled Header Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/crash/CMakeLists.txt Sets up precompiled headers for the quickshell-crash library, optimizing build times. ```cmake qs_pch(quickshell-crash SET large) ``` -------------------------------- ### Add Static Library Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/x11/i3/ipc/CMakeLists.txt Defines a static library named 'quickshell-i3-ipc' and lists its source files. ```cmake qt_add_library(quickshell-i3-ipc STATIC connection.cpp qml.cpp workspace.cpp monitor.cpp controller.cpp listener.cpp ) ``` -------------------------------- ### Define quickshell-launch Library Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/launch/CMakeLists.txt Defines a static library named 'quickshell-launch' with specified source files. ```cmake qt_add_library(quickshell-launch STATIC parsecommand.cpp command.cpp launch.cpp main.cpp ) ``` -------------------------------- ### Link X11 Initialization Library Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/x11/CMakeLists.txt Links the X11 initialization object library with Qt Quick and QML. This prepares the initialization code for linking into the final executable. ```cmake target_link_libraries(quickshell-x11-init PRIVATE Qt::Quick Qt::Qml ${XCB_LIBRARIES}) ``` -------------------------------- ### Get Git Revision Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/build/CMakeLists.txt Fetches the current Git commit hash if GIT_REVISION is not already defined. Ensures build reproducibility. ```cmake if (NOT DEFINED GIT_REVISION) execute_process( COMMAND git rev-parse HEAD WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} OUTPUT_VARIABLE GIT_REVISION OUTPUT_STRIP_TRAILING_WHITESPACE ) endif() ``` -------------------------------- ### Link Polkit Service to Main Application Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/services/polkit/CMakeLists.txt Links the main 'quickshell' application against the 'quickshell-service-polkitplugin'. This integrates the Polkit service into the main application executable. ```cmake target_link_libraries(quickshell PRIVATE quickshell-service-polkitplugin) ``` -------------------------------- ### Link Main Application Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/wayland/screencopy/CMakeLists.txt Links the main 'quickshell' application against the screencopy plugin library. ```cmake target_link_libraries(quickshell PRIVATE quickshell-wayland-screencopyplugin) ``` -------------------------------- ### Define Window Test Executable and Test Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/window/test/CMakeLists.txt Defines a CMake function to create an executable for a test, link it with required libraries, and register it as a CTest test. This function simplifies the setup for various test cases. ```cmake function (qs_test name) add_executable(${name} ${ARGN}) target_link_libraries(${name} PRIVATE Qt::Quick Qt::Test quickshell-window quickshell-core quickshell-ui quickshell-io) add_test(NAME ${name} WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" COMMAND $) endfunction() ``` -------------------------------- ### Add Static Library for IO Module Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/io/CMakeLists.txt Defines a static library named 'quickshell-io' and lists its source files. ```cmake qt_add_library(quickshell-io STATIC datastream.cpp processcore.cpp process.cpp fileview.cpp jsonadapter.cpp ipccomm.cpp ipc.cpp ipchandler.cpp ) ``` -------------------------------- ### Link Core Libraries to Window Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/window/CMakeLists.txt Links the 'quickshell-window' static library against Qt core, GUI, and Quick libraries. ```cmake target_link_libraries(quickshell-window PRIVATE Qt::Core Qt::Gui Qt::Quick Qt6::QuickPrivate ) ``` -------------------------------- ### Instantiate PopupWindow Test Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/window/test/CMakeLists.txt Calls the `qs_test` function to create and configure the test executable for the popup window functionality. ```cmake qs_test(popupwindow popupwindow.cpp) ``` -------------------------------- ### Link Libraries Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/windowmanager/CMakeLists.txt Links the window manager library with Qt::Quick and the main Quickshell executable with the window manager plugin. ```cmake target_link_libraries(quickshell-windowmanager PRIVATE Qt::Quick) ``` ```cmake target_link_libraries(quickshell PRIVATE quickshell-windowmanagerplugin) ``` -------------------------------- ### Link Libraries for Greetd Service Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/services/greetd/CMakeLists.txt Links necessary libraries to the greetd service library, including Qt::Quick and a custom quickshell-core library. Note that Qt::Qml cannot be used directly due to gui type dependencies. ```cmake # can't be Qt::Qml because generation.hpp pulls in gui types target_link_libraries(quickshell-service-greetd PRIVATE Qt::Quick quickshell-core) ``` -------------------------------- ### Add QML Module for Greetd Service Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/services/greetd/CMakeLists.txt Creates a QML module for the greetd service with a specified URI and version, depending on QtQml. ```cmake qt_add_qml_module(quickshell-service-greetd URI Quickshell.Services.Greetd VERSION 0.1 DEPENDENCIES QtQml ) ``` -------------------------------- ### Configure Precompiled Headers Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/wayland/windowmanager/CMakeLists.txt Sets up precompiled headers for the Wayland window system library, using a 'large' configuration. ```cmake qs_pch(quickshell-wayland-windowsystem SET large) ``` -------------------------------- ### Link Dependencies for quickshell-launch Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/launch/CMakeLists.txt Links the 'quickshell-launch' library against Qt modules, CLI11, and the 'quickshell-build' target. ```cmake target_link_libraries(quickshell-launch PRIVATE Qt::Quick Qt::Widgets CLI11::CLI11 quickshell-build ) ``` -------------------------------- ### Link Libraries for Polkit Service Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/services/polkit/CMakeLists.txt Links the 'quickshell-service-polkit' library against necessary Qt modules and the previously checked PkgConfig dependencies. This ensures all required functionalities are available at link time. ```cmake target_link_libraries(quickshell-service-polkit PRIVATE Qt::Qml Qt::Quick PkgConfig::glib PkgConfig::gobject PkgConfig::polkit_agent PkgConfig::polkit ) ``` -------------------------------- ### Link QML Library to Initialization Target Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/window/CMakeLists.txt Links the Qt QML library to the 'quickshell-window-init' object library. ```cmake target_link_libraries(quickshell-window-init PRIVATE Qt::Qml) ``` -------------------------------- ### Create Quickshell Wayland Static Library Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/wayland/CMakeLists.txt Defines a static library for Quickshell's Wayland components, including source files and linking necessary Wayland and Qt libraries. ```cmake qt_add_library(quickshell-wayland STATIC wl_proxy_safe_deref.cpp platformmenu.cpp popupanchor.cpp xdgshell.cpp util.cpp output_tracking.cpp ) # required for wl_proxy_safe_deref target_link_libraries(quickshell-wayland PRIVATE ${CMAKE_DL_LIBS}) target_link_options(quickshell PRIVATE "LINKER:--export-dynamic-symbol=wl_proxy_get_listener") # required to make sure the constructor is linked add_library(quickshell-wayland-init OBJECT init.cpp) set(WAYLAND_MODULES) if (WAYLAND_WLR_LAYERSHELL) add_subdirectory(wlr_layershell) target_compile_definitions(quickshell-wayland PRIVATE QS_WAYLAND_WLR_LAYERSHELL) target_compile_definitions(quickshell-wayland-init PRIVATE QS_WAYLAND_WLR_LAYERSHELL) list(APPEND WAYLAND_MODULES Quickshell.Wayland._WlrLayerShell) endif() if (WAYLAND_SESSION_LOCK) target_sources(quickshell-wayland PRIVATE session_lock.cpp) add_subdirectory(session_lock) endif() if (WAYLAND_TOPLEVEL_MANAGEMENT) add_subdirectory(toplevel) list(APPEND WAYLAND_MODULES Quickshell.Wayland._ToplevelManagement) endif() if (SCREENCOPY) add_subdirectory(buffer) add_subdirectory(screencopy) list(APPEND WAYLAND_MODULES Quickshell.Wayland._Screencopy) endif() if (HYPRLAND) add_subdirectory(hyprland) endif() add_subdirectory(background_effect) list(APPEND WAYLAND_MODULES Quickshell.Wayland._BackgroundEffect) add_subdirectory(idle_inhibit) list(APPEND WAYLAND_MODULES Quickshell.Wayland._IdleInhibitor) add_subdirectory(idle_notify) list(APPEND WAYLAND_MODULES Quickshell.Wayland._IdleNotify) add_subdirectory(shortcuts_inhibit) list(APPEND WAYLAND_MODULES Quickshell.Wayland._ShortcutsInhibitor) add_subdirectory(windowmanager) # widgets for qmenu target_link_libraries(quickshell-wayland PRIVATE Qt::Quick Qt::Widgets Qt::WaylandClient Qt::WaylandClientPrivate ) target_link_libraries(quickshell-wayland-init PRIVATE Qt::Quick) qt_add_qml_module(quickshell-wayland URI Quickshell.Wayland VERSION 0.1 DEPENDENCIES QtQuick IMPORTS ${WAYLAND_MODULES} ) qs_add_module_deps_light(quickshell-wayland Quickshell) install_qml_module(quickshell-wayland) qs_module_pch(quickshell-wayland SET large) target_link_libraries(quickshell PRIVATE quickshell-waylandplugin quickshell-wayland-init) ``` -------------------------------- ### Apply Precompiled Header to Target Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/launch/CMakeLists.txt Applies the precompiled header set 'launch' to the 'quickshell-launch' target. ```cmake qs_pch(quickshell-launch SET launch) ``` -------------------------------- ### Set Project Standard and QML Output Directory Source: https://github.com/quickshell-mirror/quickshell/blob/master/CMakeLists.txt Configures standard project settings for Qt, including the required Qt version and the output directory for QML modules. ```cmake set(CMAKE_AUTOUIC OFF) qt_standard_project_setup(REQUIRES 6.6) set(QT_QML_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/qml_modules) ``` -------------------------------- ### Instantiate Datastream Test Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/io/test/CMakeLists.txt Uses the qs_test function to define the 'datastream' test executable, compiling 'datastream.cpp' and including '../datastream.cpp'. ```cmake qs_test(datastream datastream.cpp ../datastream.cpp) ``` -------------------------------- ### Check Polkit and GLib Dependencies Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/services/polkit/CMakeLists.txt Checks for required PkgConfig modules including glib-2.0, gobject-2.0, polkit-agent-1, and polkit-gobject-1. Ensures these dependencies are available before proceeding. ```cmake find_package(PkgConfig REQUIRED) pkg_check_modules(glib REQUIRED IMPORTED_TARGET glib-2.0>=2.36) pkg_check_modules(gobject REQUIRED IMPORTED_TARGET gobject-2.0) pkg_check_modules(polkit_agent REQUIRED IMPORTED_TARGET polkit-agent-1) pkg_check_modules(polkit REQUIRED IMPORTED_TARGET polkit-gobject-1) ``` -------------------------------- ### Link Network Library with Dependencies Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/network/CMakeLists.txt Links the 'quickshell-network' static library against its specific dependencies, including the 'quickshell-network-nm' library and Qt modules. This ensures all necessary components are available at link time. ```cmake target_link_libraries(quickshell-network PRIVATE quickshell-network-nm Qt::Qml Qt::DBus) ``` -------------------------------- ### Create Static Library for Network Module Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/network/CMakeLists.txt Defines a static library named 'quickshell-network' with specified source files. This is used to compile the core networking components. ```cmake qt_add_library(quickshell-network STATIC network.cpp device.cpp wired.cpp wifi.cpp enums.cpp qml.cpp ) ``` -------------------------------- ### Add X11 Static Library Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/x11/CMakeLists.txt Defines a static library named 'quickshell-x11' and lists its source files. This library encapsulates X11-related functionalities. ```cmake qt_add_library(quickshell-x11 STATIC util.cpp panel_window.cpp ) ``` -------------------------------- ### Link Main Quickshell Library Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/x11/CMakeLists.txt Links the main 'quickshell' library with the X11 plugin and initialization libraries. This integrates all X11-related components into the final Quickshell application. ```cmake target_link_libraries(quickshell PRIVATE quickshell-x11plugin quickshell-x11-init) ``` -------------------------------- ### Link Greetd Service Plugin to Main Application Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/services/greetd/CMakeLists.txt Links the greetd service plugin library to the main quickshell application. ```cmake target_link_libraries(quickshell PRIVATE quickshell-service-greetdplugin) ``` -------------------------------- ### Add Module Dependencies Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/window/CMakeLists.txt Specifies light dependencies for the 'quickshell-window' module, linking it to the 'Quickshell' module. ```cmake qs_add_module_deps_light(quickshell-window Quickshell) ``` -------------------------------- ### Link Libraries for IO Module Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/io/CMakeLists.txt Links necessary libraries for the 'quickshell-io' static library and the main 'quickshell' executable. ```cmake target_link_libraries(quickshell-io PRIVATE Qt::Quick quickshell-ipc) target_link_libraries(quickshell PRIVATE quickshell-ioplugin) ``` -------------------------------- ### Link Main Executable with Network Plugin Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/network/CMakeLists.txt Links the main 'quickshell' executable against the 'quickshell-networkplugin'. This integrates the network functionality into the main application. ```cmake target_link_libraries(quickshell PRIVATE quickshell-networkplugin) ``` -------------------------------- ### Link quickshell-launch to quickshell Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/launch/CMakeLists.txt Links the 'quickshell-launch' library into the main 'quickshell' target. ```cmake target_link_libraries(quickshell PRIVATE quickshell-launch) ``` -------------------------------- ### Configure Precompiled Header Set for Launch Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/launch/CMakeLists.txt Creates a precompiled header set named 'launch' for the 'quickshell-launch' target, specifying dependencies and header files. ```cmake qs_add_pchset(launch DEPENDENCIES Qt::Core CLI11::CLI11 HEADERS ) ``` -------------------------------- ### Linter Configuration for Quickshell Source: https://github.com/quickshell-mirror/quickshell/blob/master/HACKING.md To run the linter, disable precompiled headers and enable test codepaths during configuration. Use `just lint-changed` to check modified files. ```sh $ just configure debug -DNO_PCH=ON -DBUILD_TESTING=ON $ just lint-changed ``` -------------------------------- ### Link QtQuick Library Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/debug/CMakeLists.txt Links the 'quickshell-debug' static library against the Qt::Quick module for Qt Quick functionality. ```cmake target_link_libraries(quickshell-debug PRIVATE Qt::Quick) ``` -------------------------------- ### Add QML Module for IO Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/io/CMakeLists.txt Configures 'quickshell-io' as a QML module with a specific URI, version, and QML files. ```cmake qt_add_qml_module(quickshell-io URI Quickshell.Io VERSION 0.1 DEPENDENCIES QtQml QML_FILES FileView.qml ) ``` -------------------------------- ### Find and Link Jemalloc Source: https://github.com/quickshell-mirror/quickshell/blob/master/CMakeLists.txt Finds the jemalloc package using PkgConfig and links it to the 'quickshell' target if USE_JEMALLOC is enabled. ```cmake if (USE_JEMALLOC) find_package(PkgConfig REQUIRED) # IMPORTED_TARGET not working for some reason pkg_check_modules(JEMALLOC REQUIRED jemalloc) target_link_libraries(quickshell PRIVATE ${JEMALLOC_LIBRARIES}) endif() ``` -------------------------------- ### Link Libraries for PipeWire Service Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/services/pipewire/CMakeLists.txt Links the necessary libraries to the PipeWire service static library, including QtQml, PkgConfig::pipewire, and Qt::Quick. ```cmake target_link_libraries(quickshell-service-pipewire PRIVATE Qt::Qml PkgConfig::pipewire Qt::Quick # pch ) ``` -------------------------------- ### Create QML Module for i3 Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/x11/i3/CMakeLists.txt Configures a QML module for 'quickshell-i3' with a specified URI, version, and imports. This makes i3-related QML components available to the application. ```cmake qt_add_qml_module(quickshell-i3 URI Quickshell.I3 VERSION 0.1 IMPORTS ${I3_MODULES} ) ``` -------------------------------- ### Add Module Dependencies Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/wayland/hyprland/focus_grab/CMakeLists.txt Specifies light dependencies for the Hyprland focus grab module, linking it to the main Quickshell module. ```cmake qs_add_module_deps_light(quickshell-hyprland-focus-grab Quickshell) ``` -------------------------------- ### Add Module Dependencies Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/io/CMakeLists.txt Specifies light dependencies for the 'quickshell-io' module on the 'Quickshell' module. ```cmake qs_add_module_deps_light(quickshell-io Quickshell) ``` -------------------------------- ### Create Polkit Service QML Module Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/services/polkit/CMakeLists.txt Defines a QML module for the Polkit service with a specific URI and version. This allows the service to be exposed and used within QML applications. ```cmake qt_add_qml_module(quickshell-service-polkit URI Quickshell.Services.Polkit VERSION 0.1 DEPENDENCIES QtQml ) ``` -------------------------------- ### Add QML Module Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/x11/i3/ipc/CMakeLists.txt Configures 'quickshell-i3-ipc' as a QML module with a specific URI and version. ```cmake qt_add_qml_module(quickshell-i3-ipc URI Quickshell.I3._Ipc VERSION 0.1 DEPENDENCIES QtQml ) ``` -------------------------------- ### Configure Precompiled Headers for Greetd Service Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/services/greetd/CMakeLists.txt Configures precompiled headers for the greetd service module. ```cmake qs_module_pch(quickshell-service-greetd) ``` -------------------------------- ### Link Main Executable Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/wayland/idle_notify/CMakeLists.txt Links the main 'quickshell' executable to the Wayland idle notification plugin library. ```cmake target_link_libraries(quickshell PRIVATE quickshell-wayland-idle-notifyplugin) ``` -------------------------------- ### Link Toplevel Management Plugin to Main Application Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/wayland/toplevel/CMakeLists.txt Links the main 'quickshell' application against the Wayland toplevel management plugin. ```cmake target_link_libraries(quickshell PRIVATE quickshell-wayland-toplevel-managementplugin) ``` -------------------------------- ### Build Project with CMake Source: https://github.com/quickshell-mirror/quickshell/blob/master/BUILD.md Execute the build process using CMake, which will invoke the configured build system (Ninja in this case) to compile the project. This command assumes the build directory has already been configured. ```sh cmake --build build ``` -------------------------------- ### Link Library for Quickshell Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/x11/i3/ipc/CMakeLists.txt Links the main 'quickshell' target with the 'quickshell-i3-ipcplugin'. ```cmake target_link_libraries(quickshell PRIVATE quickshell-i3-ipcplugin) ``` -------------------------------- ### Link Main Project with Wayland Components Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/wayland/windowmanager/CMakeLists.txt Links the main project target with the Wayland window system static library and its initialization object library. ```cmake target_link_libraries(quickshell PRIVATE quickshell-wayland-windowsystem quickshell-wayland-windowsystem-init) ``` -------------------------------- ### Link DBus Menu Plugin to Main Executable Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/dbus/dbusmenu/CMakeLists.txt Links the main Quickshell executable against the quickshell-dbusmenuplugin library. ```cmake target_link_libraries(quickshell PRIVATE quickshell-dbusmenuplugin) ``` -------------------------------- ### Add Module Dependencies (Light) Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/network/CMakeLists.txt Specifies light dependencies for the 'quickshell-network' module, linking it to the 'Quickshell' core module. This is a custom macro for managing module interdependencies. ```cmake qs_add_module_deps_light(quickshell-network Quickshell) ``` -------------------------------- ### Add Static Library for i3 Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/x11/i3/CMakeLists.txt Defines a static library target named 'quickshell-i3'. This is a foundational step for organizing i3-related code. ```cmake qt_add_library(quickshell-i3 STATIC) ``` -------------------------------- ### Link Main Project with Surface Extensions Plugin Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/wayland/hyprland/surface/CMakeLists.txt Links the main Quickshell project against the Hyprland surface extensions plugin. ```cmake target_link_libraries(quickshell PRIVATE quickshell-hyprland-surface-extensionsplugin) ``` -------------------------------- ### Link Libraries Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/widgets/CMakeLists.txt Links the 'quickshell-widgets' library against Qt::Quick and links the main 'quickshell' target against the 'quickshell-widgetsplugin'. ```cmake target_link_libraries(quickshell-widgets PRIVATE Qt::Quick) target_link_libraries(quickshell PRIVATE quickshell-widgetsplugin) ``` -------------------------------- ### Add Quickshell Debug Static Library Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/debug/CMakeLists.txt Defines a static library target named 'quickshell-debug' and includes source files for linting. ```cmake qt_add_library(quickshell-debug STATIC lint.cpp ) ``` -------------------------------- ### Link i3 Plugin to Main Library Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/x11/i3/CMakeLists.txt Links the 'quickshell-i3plugin' to the main 'quickshell' library. This integrates the i3 plugin's functionality into the core application. ```cmake target_link_libraries(quickshell PRIVATE quickshell-i3plugin) ``` -------------------------------- ### Link X11 Static Library Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/x11/CMakeLists.txt Links the 'quickshell-x11' static library with Qt Quick and XCB libraries. This makes X11 functionalities available to the main Quickshell library. ```cmake target_link_libraries(quickshell-x11 PRIVATE Qt::Quick ${XCB_LIBRARIES}) ``` -------------------------------- ### Define Hyprland Screencopy Static Library Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/wayland/screencopy/hyprland_screencopy/CMakeLists.txt Defines a static library named 'quickshell-wayland-screencopy-hyprland' and lists its source files. ```cmake qt_add_library(quickshell-wayland-screencopy-hyprland STATIC hyprland_screencopy.cpp ) ``` -------------------------------- ### Configure Precompiled Headers Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/debug/CMakeLists.txt Enables precompiled headers for the 'quickshell-debug' target to improve build performance. ```cmake qs_pch(quickshell-debug) ``` -------------------------------- ### Link Global Shortcuts Plugin to Main Executable Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/wayland/hyprland/global_shortcuts/CMakeLists.txt Links the Hyprland global shortcuts plugin library to the main 'quickshell' executable. ```cmake target_link_libraries(quickshell PRIVATE quickshell-hyprland-global-shortcutsplugin) ``` -------------------------------- ### Link Libraries for i3 IPC Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/x11/i3/ipc/CMakeLists.txt Links the 'quickshell-i3-ipc' library with QtQuick and 'quickshell-core'. ```cmake target_link_libraries(quickshell-i3-ipc PRIVATE Qt::Quick quickshell-core) ``` -------------------------------- ### Conditionally Add Socket Source File Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/io/CMakeLists.txt Adds 'socket.cpp' to the 'quickshell-io' library sources only if the SOCKETS build option is enabled. ```cmake if (SOCKETS) target_sources(quickshell-io PRIVATE socket.cpp) endif() ``` -------------------------------- ### Link Main Application with IPC Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/ipc/CMakeLists.txt Links the main quickshell application against the compiled IPC library. ```cmake target_link_libraries(quickshell PRIVATE quickshell-ipc) ``` -------------------------------- ### Add QML Module Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/widgets/CMakeLists.txt Configures a QML module for the 'quickshell-widgets' library, specifying the URI, version, and QML files. ```cmake qt_add_qml_module(quickshell-widgets URI Quickshell.Widgets VERSION 0.1 QML_FILES IconImage.qml ClippingRectangle.qml WrapperItem.qml WrapperMouseArea.qml WrapperRectangle.qml ClippingWrapperRectangle.qml ClippingWrapperRectangleInternal.qml ) ``` -------------------------------- ### Add Module Dependencies Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/x11/i3/ipc/CMakeLists.txt Specifies light dependencies for the 'quickshell-i3-ipc' module, including 'Quickshell'. ```cmake qs_add_module_deps_light(quickshell-i3-ipc Quickshell) ``` -------------------------------- ### Set Include Directories Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/wayland/screencopy/CMakeLists.txt Adds the binary directory to the include path for the screencopy library. ```cmake target_include_directories(quickshell-wayland-screencopy PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) ``` -------------------------------- ### Link Plugin Library Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/wayland/idle_inhibit/CMakeLists.txt Links the main Quickshell library with the Wayland idle inhibitor plugin library. ```cmake target_link_libraries(quickshell PRIVATE quickshell-wayland-idle-inhibitplugin) ``` -------------------------------- ### Link Libraries for DBus Menu Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/dbus/dbusmenu/CMakeLists.txt Links the DBus menu library against Qt Quick and Qt DBus, and adds specific Quickshell DBus dependencies. ```cmake target_link_libraries(quickshell-dbusmenu PRIVATE Qt::Quick Qt::DBus) qs_add_link_dependencies(quickshell-dbusmenu quickshell-dbus) ``` -------------------------------- ### Add Light Module Dependencies Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/dbus/dbusmenu/CMakeLists.txt Adds light dependencies for a module, linking it to other Quickshell components. ```cmake qs_add_module_deps_light(quickshell-dbusmenu Quickshell) ``` -------------------------------- ### Define QML Module for Window Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/window/CMakeLists.txt Registers 'quickshell-window' as a QML module with a specific URI and version, depending on QtQuick. ```cmake qt_add_qml_module(quickshell-window URI Quickshell._Window VERSION 0.1 DEPENDENCIES QtQuick ) ``` -------------------------------- ### Add quickshell-core static library Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/core/CMakeLists.txt Defines the quickshell-core library as a static library. It lists all the source files that will be compiled into this library. ```cmake qt_add_library(quickshell-core STATIC plugin.cpp shell.cpp variants.cpp rootwrapper.cpp reload.cpp rootwrapper.cpp qmlglobal.cpp qmlscreen.cpp region.cpp persistentprops.cpp singleton.cpp generation.cpp scan.cpp scanenv.cpp qsintercept.cpp incubator.cpp lazyloader.cpp easingcurve.cpp iconimageprovider.cpp imageprovider.cpp transformwatcher.cpp boundcomponent.cpp model.cpp elapsedtimer.cpp desktopentry.cpp desktopentrymonitor.cpp platformmenu.cpp qsmenu.cpp retainable.cpp popupanchor.cpp types.cpp qsmenuanchor.cpp clock.cpp logging.cpp paths.cpp instanceinfo.cpp common.cpp iconprovider.cpp scriptmodel.cpp colorquantizer.cpp toolsupport.cpp streamreader.cpp debuginfo.cpp ) ``` -------------------------------- ### Add Static Library for Quickshell UI Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/ui/CMakeLists.txt Defines a static library for the Quickshell UI components. This is a common practice for organizing UI code. ```cmake qt_add_library(quickshell-ui STATIC reload_popup.cpp ) ``` -------------------------------- ### Add Module Dependencies Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/wayland/idle_inhibit/CMakeLists.txt Adds light dependencies for the Wayland idle inhibitor module, including the Quickshell module. ```cmake qs_add_module_deps_light(quickshell-wayland-idle-inhibit Quickshell) ``` -------------------------------- ### Link Qt Dependencies Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/x11/i3/CMakeLists.txt Links the necessary Qt dependencies to the 'quickshell-i3' library. Ensure that ${QT_DEPS} is correctly defined elsewhere in the CMake configuration. ```cmake target_link_libraries(quickshell-i3 PRIVATE ${QT_DEPS}) ``` -------------------------------- ### Find Qt6 Packages Source: https://github.com/quickshell-mirror/quickshell/blob/master/CMakeLists.txt Finds and configures Qt6, requiring core components and optionally private components based on version compatibility. ```cmake find_package(Qt6 REQUIRED COMPONENTS ${QT_FPDEPS}) # In Qt 6.10, private dependencies are required to be explicit, # but they could not be explicitly depended on prior to 6.9. if (Qt6_VERSION VERSION_GREATER_EQUAL "6.9.0") set(QT_NO_PRIVATE_MODULE_WARNING ON) find_package(Qt6 REQUIRED COMPONENTS ${QT_PRIVDEPS}) endif() ``` -------------------------------- ### Instantiate WindowAttached Test Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/window/test/CMakeLists.txt Calls the `qs_test` function to create and configure the test executable for the window attached functionality. ```cmake qs_test(windowattached windowattached.cpp) ``` -------------------------------- ### Build Quickshell Test Targets Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/core/test/CMakeLists.txt Invokes the `qs_test` function to build specific Quickshell test executables and register them as tests. Each call compiles a test file and links it with the defined libraries. ```cmake qs_test(transformwatcher transformwatcher.cpp) ``` ```cmake qs_test(ringbuffer ringbuf.cpp) ``` ```cmake qs_test(scriptmodel scriptmodel.cpp) ``` ```cmake qs_test(stacklist stacklist.cpp) ``` ```cmake qs_test(objectmodel objectmodel.cpp) ``` -------------------------------- ### Define Static Library Target Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/widgets/CMakeLists.txt Defines a static library target named 'quickshell-widgets' with specified source files. ```cmake qt_add_library(quickshell-widgets STATIC cliprect.cpp wrapper.cpp marginwrapper.cpp ) ``` -------------------------------- ### Link Wayland Window System Libraries Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/wayland/windowmanager/CMakeLists.txt Links the Wayland window system library with necessary Qt modules, Wayland client libraries, and custom protocols. ```cmake target_link_libraries(quickshell-wayland-windowsystem PRIVATE Qt::Quick Qt::WaylandClient Qt::WaylandClientPrivate wayland-client wlp-ext-workspace ) ``` -------------------------------- ### Link Plugin to Main Target Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/wayland/hyprland/focus_grab/CMakeLists.txt Links the Hyprland focus grab plugin library to the main Quickshell target. ```cmake target_link_libraries(quickshell PRIVATE quickshell-hyprland-focus-grabplugin) ``` -------------------------------- ### Vendor Cpptrace Source: https://github.com/quickshell-mirror/quickshell/blob/master/BUILD.md Set `-DVENDOR_CPPTRACE=ON` to vendor cpptrace using FetchContent. This requires `libunwind` and optionally `libdwarf`. ```bash -DVENDOR_CPPTRACE=ON ``` -------------------------------- ### Compile Shaders (Basic) Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/widgets/CMakeLists.txt Compiles fragment shaders for the 'widgets-cliprect' target without using HLSL or MSL, optimizing for batch processing. ```cmake qt6_add_shaders(quickshell-widgets "widgets-cliprect" NOHLSL NOMSL BATCHABLE PRECOMPILE OPTIMIZED QUIET PREFIX "/Quickshell/Widgets" FILES shaders/cliprect.frag OUTPUTS shaders/cliprect.frag.qsb ) ``` -------------------------------- ### Configure Precompiled Header Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/wayland/session_lock/CMakeLists.txt Sets up precompiled headers for the Wayland session lock library, using a 'large' configuration. ```cmake qs_pch(quickshell-wayland-sessionlock SET large) ``` -------------------------------- ### Add QML Module Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/wayland/hyprland/global_shortcuts/CMakeLists.txt Configures a QML module for the Hyprland global shortcuts, specifying URI, version, and dependencies. ```cmake qt_add_qml_module(quickshell-hyprland-global-shortcuts URI Quickshell.Hyprland._GlobalShortcuts VERSION 0.1 DEPENDENCIES QtQml ) ``` -------------------------------- ### Generate Precompiled Headers Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/x11/i3/CMakeLists.txt Generates precompiled headers for 'quickshell-i3' and 'quickshell-i3plugin'. This can improve build times by caching compilation results. ```cmake qs_pch(quickshell-i3) ``` ```cmake qs_pch(quickshell-i3plugin) ``` -------------------------------- ### Link Libraries Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/wayland/idle_inhibit/CMakeLists.txt Links necessary libraries to the Wayland idle inhibitor static library, including Qt modules and the Wayland client library. ```cmake target_link_libraries(quickshell-wayland-idle-inhibit PRIVATE Qt::Quick Qt::WaylandClient Qt::WaylandClientPrivate wayland-client wlp-idle-inhibit ) ``` -------------------------------- ### Link Wayland Client Dependencies Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/wayland/screencopy/wlr_screencopy/CMakeLists.txt Links the static library against Wayland client libraries and Qt Wayland modules. Use 'PRIVATE' for internal dependencies. ```cmake target_link_libraries(quickshell-wayland-screencopy-wlr PRIVATE Qt::WaylandClient Qt::WaylandClientPrivate wayland-client Qt::Quick # for pch ) ``` -------------------------------- ### Link libraries for quickshell-core Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/core/CMakeLists.txt Links the quickshell-core library against Qt modules (Quick, QuickPrivate, Widgets), the quickshell-build target, and the PkgConfig libdrm dependency. ```cmake target_link_libraries(quickshell-core PRIVATE Qt::Quick Qt::QuickPrivate Qt::Widgets quickshell-build PkgConfig::libdrm) ``` -------------------------------- ### Link PipeWire Service Plugin Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/services/pipewire/CMakeLists.txt Links the PipeWire service plugin to the main Quickshell target. ```cmake target_link_libraries(quickshell PRIVATE quickshell-service-pipewireplugin) ``` -------------------------------- ### Link Background Effect Plugin to Main Target Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/wayland/background_effect/CMakeLists.txt Links the Wayland background effect plugin library to the main 'quickshell' target. ```cmake target_link_libraries(quickshell PRIVATE quickshell-wayland-background-effectplugin) ``` -------------------------------- ### Set Private Include Directories Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/network/CMakeLists.txt Configures private include directories for the 'quickshell-network' target. This ensures that header files within the build directory are accessible during compilation. ```cmake target_include_directories(quickshell-network PRIVATE ${CMAKE_CURRENT_BINARY_DIR} ) ``` -------------------------------- ### Add Build Directory to Include Directories Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/build/CMakeLists.txt Adds the binary directory to the include path for the quickshell-build target. This allows including generated headers. ```cmake target_include_directories(quickshell-build INTERFACE ${CMAKE_CURRENT_BINARY_DIR}) ``` -------------------------------- ### Link Libraries for Quickshell UI Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/ui/CMakeLists.txt Links the 'quickshell-ui' static library against Qt::Quick privately. It also links the main Quickshell executable against the 'quickshell-uiplugin' library. ```cmake target_link_libraries(quickshell-ui PRIVATE Qt::Quick) target_link_libraries(quickshell PRIVATE quickshell-uiplugin) ``` -------------------------------- ### Link Libraries for Background Effect Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/wayland/background_effect/CMakeLists.txt Links the necessary Qt and Wayland libraries, as well as the defined Wayland protocol, to the background effect library. ```cmake target_link_libraries(quickshell-wayland-background-effect PRIVATE Qt::Quick Qt::WaylandClient Qt::WaylandClientPrivate wayland-client wlp-background-effect ) ``` -------------------------------- ### Add Static Library for Window Module Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/window/CMakeLists.txt Defines a static library for the window module, listing its source files. ```cmake qt_add_library(quickshell-window STATIC proxywindow.cpp windowinterface.cpp panelinterface.cpp floatingwindow.cpp popupwindow.cpp ) ``` -------------------------------- ### Enable Precompiled Headers for IPC Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/ipc/CMakeLists.txt Enables precompiled headers for the quickshell-ipc target to improve build performance. ```cmake qs_pch(quickshell-ipc) ``` -------------------------------- ### Add Services Subdirectory Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/CMakeLists.txt Includes the services subdirectory into the build process. ```cmake add_subdirectory(services) ``` -------------------------------- ### Add QML Module Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/wayland/idle_inhibit/CMakeLists.txt Configures a QML module for the Wayland idle inhibitor, specifying its URI, version, and dependencies. ```cmake qt_add_qml_module(quickshell-wayland-idle-inhibit URI Quickshell.Wayland._IdleInhibitor VERSION 0.1 DEPENDENCIES QtQuick ) ``` -------------------------------- ### PAM Configuration: Fingerprint then Password Fallback Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/services/pam/module.md Use this snippet to attempt fingerprint authentication first, falling back to password authentication if the fingerprint fails. ```pam auth sufficient pam_fprintd.so auth required pam_unix.so ``` -------------------------------- ### Add Executable Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/CMakeLists.txt Defines the main executable for the project. ```cmake qt_add_executable(quickshell main.cpp) ``` -------------------------------- ### Link Libraries for Static Library Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/wayland/hyprland/focus_grab/CMakeLists.txt Links necessary libraries to the Hyprland focus grab static library, including Qt modules and Wayland client libraries. ```cmake target_link_libraries(quickshell-hyprland-focus-grab PRIVATE Qt::Quick Qt::WaylandClient Qt::WaylandClientPrivate wayland-client wlp-hyprland-focus-grab ) ``` -------------------------------- ### Add Static Library Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/wayland/hyprland/global_shortcuts/CMakeLists.txt Defines a static library for the Hyprland global shortcuts module with specified source files. ```cmake qt_add_library(quickshell-hyprland-global-shortcuts STATIC qml.cpp manager.cpp shortcut.cpp ) ``` -------------------------------- ### Add QML Module Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/wayland/background_effect/CMakeLists.txt Configures a QML module for the Wayland background effect, specifying its URI, version, and dependencies. ```cmake qt_add_qml_module(quickshell-wayland-background-effect URI Quickshell.Wayland._BackgroundEffect VERSION 0.1 DEPENDENCIES QtQml ) ``` -------------------------------- ### Link Libraries for Toplevel Management Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/wayland/toplevel/CMakeLists.txt Links the Wayland toplevel management library against Qt, Wayland client libraries, and the foreign toplevel protocol. ```cmake target_link_libraries(quickshell-wayland-toplevel-management PRIVATE Qt::Quick Qt::WaylandClient Qt::WaylandClientPrivate wayland-client wlp-foreign-toplevel ) ``` -------------------------------- ### Add QML Module for DBus Menu Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/dbus/dbusmenu/CMakeLists.txt Creates a QML module for the DBus menu component, specifying its URI, version, and dependencies. ```cmake qt_add_qml_module(quickshell-dbusmenu URI Quickshell.DBusMenu VERSION 0.1 DEPENDENCIES QtQml ) ``` -------------------------------- ### Add QML Module Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/wayland/screencopy/CMakeLists.txt Configures a QML module for the screencopy library, specifying its URI, version, and dependencies. ```cmake qt_add_qml_module(quickshell-wayland-screencopy URI Quickshell.Wayland._Screencopy VERSION 0.1 DEPENDENCIES QtQuick ) ``` -------------------------------- ### Create Static Library for Wayland Window Manager Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/wayland/windowmanager/CMakeLists.txt Defines a static library for the Wayland window manager component, specifying its source files. ```cmake qt_add_library(quickshell-wayland-windowsystem STATIC windowmanager.cpp windowset.cpp ext_workspace.cpp ) ``` -------------------------------- ### Link Libraries for Quickshell Crash Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/crash/CMakeLists.txt Links the necessary libraries to the quickshell-crash target, including quickshell-build, Qt modules, and cpptrace. ```cmake # quick linked for pch compat target_link_libraries(quickshell-crash PRIVATE quickshell-build Qt::Quick Qt::Widgets cpptrace::cpptrace) ``` -------------------------------- ### Create Static Library for DBus Menu Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/dbus/dbusmenu/CMakeLists.txt Defines a static library for the DBus menu component, including source files and generated DBus interfaces. ```cmake qt_add_library(quickshell-dbusmenu STATIC dbus_menu_types.cpp dbusmenu.cpp ${DBUS_INTERFACES} ) ``` -------------------------------- ### Configure Build with CMake and Ninja Source: https://github.com/quickshell-mirror/quickshell/blob/master/BUILD.md Configure the build using CMake with the Ninja generator. Ensure all necessary dependencies are provided or features are explicitly disabled using flags to prevent build failures. This command sets up the build directory and specifies a Release build type. ```sh cmake -GNinja -B build -DCMAKE_BUILD_TYPE=Release [additional disable flags from above here] ``` -------------------------------- ### Define Quickshell Build Library Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/build/CMakeLists.txt Defines an INTERFACE library for the Quickshell build. This is a common practice for organizing build targets. ```cmake add_library(quickshell-build INTERFACE) ``` -------------------------------- ### Add Module Dependencies Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/wayland/hyprland/ipc/CMakeLists.txt Specifies light dependencies for the Hyprland IPC module, linking it with the core Quickshell module. This ensures necessary functionalities are available. ```cmake qs_add_module_deps_light(quickshell-hyprland-ipc Quickshell) ``` -------------------------------- ### Add Static Library Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/windowmanager/CMakeLists.txt Defines a static library for the window manager component, specifying its source files. ```cmake qt_add_library(quickshell-windowmanager STATIC screenprojection.cpp windowmanager.cpp windowset.cpp ) ``` -------------------------------- ### Link Qt Dependencies Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/wayland/hyprland/CMakeLists.txt Links the necessary Qt dependencies to the Hyprland library. Ensures all required Qt functionalities are available. ```cmake target_link_libraries(quickshell-hyprland PRIVATE ${QT_DEPS}) ``` -------------------------------- ### Adding Compiler Options Source: https://github.com/quickshell-mirror/quickshell/blob/master/CMakeLists.txt Adds standard compiler warnings for C++ code. ```cmake add_compile_options(-Wall -Wextra -Wno-vla-cxx-extension) ``` -------------------------------- ### Add quickshell-core QML module Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/core/CMakeLists.txt Configures quickshell-core as a QML module with a specific URI, version, and import dependencies. It specifies optional and default imports for Quickshell._Window. ```cmake qt_add_qml_module(quickshell-core URI Quickshell VERSION 0.1 DEPENDENCIES QtQuick OPTIONAL_IMPORTS Quickshell._Window DEFAULT_IMPORTS Quickshell._Window ) ``` -------------------------------- ### Link IPC Library with Qt Modules Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/ipc/CMakeLists.txt Links the IPC static library against Qt Quick and Qt Network modules. ```cmake target_link_libraries(quickshell-ipc PRIVATE Qt::Quick Qt::Network) ``` -------------------------------- ### Link Libraries for Hyprland IPC Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/wayland/hyprland/ipc/CMakeLists.txt Links the Hyprland IPC static library with Qt Quick and the core Quickshell library. This resolves dependencies for runtime execution. ```cmake target_link_libraries(quickshell-hyprland-ipc PRIVATE Qt::Quick quickshell-core) ``` -------------------------------- ### Add Link Dependencies for Debug Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/window/CMakeLists.txt Adds specific link dependencies for the 'quickshell-window' module, including 'quickshell-debug'. ```cmake qs_add_link_dependencies(quickshell-window quickshell-debug) ``` -------------------------------- ### Link quickshell-core plugin to quickshell Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/core/CMakeLists.txt Links the quickshell executable against the quickshell-coreplugin library. ```cmake target_link_libraries(quickshell PRIVATE quickshell-coreplugin) ``` -------------------------------- ### Add Quickshell Crash Static Library Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/crash/CMakeLists.txt Defines the static library for the Quickshell crash module and lists its source files. ```cmake qt_add_library(quickshell-crash STATIC main.cpp interface.cpp handler.cpp ) ``` -------------------------------- ### Link Quickshell with Hyprland IPC Plugin Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/wayland/hyprland/ipc/CMakeLists.txt Links the main Quickshell executable with the Hyprland IPC plugin library. This integrates the IPC functionality into the main application. ```cmake target_link_libraries(quickshell PRIVATE quickshell-hyprland-ipcplugin) ``` -------------------------------- ### Link Libraries Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/wayland/screencopy/CMakeLists.txt Links the screencopy library against necessary Qt modules, Wayland libraries, and other internal modules. ```cmake target_link_libraries(quickshell-wayland-screencopy PRIVATE Qt::Quick Qt::WaylandClient Qt::WaylandClientPrivate wayland-client quickshell-wayland-buffer ${SCREENCOPY_MODULES} ) ``` -------------------------------- ### Create Hyprland QML Module Source: https://github.com/quickshell-mirror/quickshell/blob/master/src/wayland/hyprland/CMakeLists.txt Configures the QML module for Hyprland, specifying its URI, version, and imported modules. This makes Hyprland components available in QML. ```cmake qt_add_qml_module(quickshell-hyprland URI Quickshell.Hyprland VERSION 0.1 IMPORTS ${HYPRLAND_MODULES} ) ```