### Install Executable Symlink Source: https://github.com/quickshell/quickshell/blob/master/CMakeLists.txt Creates a symbolic link for the installed executable. The installed binary will be named 'quickshell', and a symlink 'qs' will be created in the installation bin directory. ```cmake install(CODE " execute_process( COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_INSTALL_FULL_BINDIR}/quickshell \$ENV{DESTDIR}${CMAKE_INSTALL_FULL_BINDIR}/qs ) ") ``` -------------------------------- ### Install Executable Source: https://github.com/quickshell/quickshell/blob/master/src/CMakeLists.txt Installs the built executable to the runtime destination. ```cmake install(TARGETS quickshell RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) ``` -------------------------------- ### Install QML Module Source: https://github.com/quickshell/quickshell/blob/master/src/windowmanager/CMakeLists.txt Installs the 'quickshell-windowmanager' QML module. ```cmake install_qml_module(quickshell-windowmanager) ``` -------------------------------- ### Install QML Module Source: https://github.com/quickshell/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 Desktop Entry File Source: https://github.com/quickshell/quickshell/blob/master/CMakeLists.txt Installs the org.quickshell.desktop file to the applications data directory. ```cmake install( FILES ${CMAKE_SOURCE_DIR}/assets/org.quickshell.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications ) ``` -------------------------------- ### Install QML Module Source: https://github.com/quickshell/quickshell/blob/master/src/io/CMakeLists.txt Installs the QML module defined for 'quickshell-io'. ```cmake install_qml_module(quickshell-io) ``` -------------------------------- ### Install Quickshell Source: https://github.com/quickshell/quickshell/blob/master/BUILD.md Run this command to install the built Quickshell project to its designated location. ```sh cmake --install build ``` -------------------------------- ### Install QML Module Source: https://github.com/quickshell/quickshell/blob/master/src/x11/i3/ipc/CMakeLists.txt Installs the i3 IPC QML module. ```cmake install_qml_module(quickshell-i3-ipc) ``` -------------------------------- ### Standard Project Setup Source: https://github.com/quickshell/quickshell/blob/master/CMakeLists.txt Sets up the standard project configuration for Qt6.6. Sets the QML output directory. ```cmake set(CMAKE_AUTOUIC OFF) qt_standard_project_setup(REQUIRES 6.6) set(QT_QML_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/qml_modules) ``` -------------------------------- ### Install QML Module Source: https://github.com/quickshell/quickshell/blob/master/src/widgets/CMakeLists.txt Installs the QML module for quickshell-widgets, making it available for use. ```cmake install_qml_module(quickshell-widgets) ``` -------------------------------- ### Install QML Module Source: https://github.com/quickshell/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 Application Icon Source: https://github.com/quickshell/quickshell/blob/master/CMakeLists.txt Installs the quickshell.svg icon to the scalable apps directory in the hicolor icon theme, renaming it to org.quickshell.svg. ```cmake install( FILES ${CMAKE_SOURCE_DIR}/assets/quickshell.svg DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/scalable/apps RENAME org.quickshell.svg ) ``` -------------------------------- ### Install QML Module Source: https://github.com/quickshell/quickshell/blob/master/src/window/CMakeLists.txt Installs the 'quickshell-window' QML module. This makes the module available for use in deployed applications. ```cmake install_qml_module(quickshell-window) ``` -------------------------------- ### PAM Configuration Structure Example Source: https://github.com/quickshell/quickshell/blob/master/src/services/pam/module.md Illustrates the basic structure of a PAM rule line, including type, control flag, module path, and options. ```plaintext [options] ``` -------------------------------- ### Install QML Module Source: https://github.com/quickshell/quickshell/blob/master/src/core/CMakeLists.txt Installs the configured QML module to the appropriate location for runtime access. ```cmake install_qml_module(quickshell-core) ``` -------------------------------- ### Install Polkit Service QML Module Source: https://github.com/quickshell/quickshell/blob/master/src/services/polkit/CMakeLists.txt Installs the configured QML module for the Polkit service. This makes the module accessible at runtime. ```cmake install_qml_module(quickshell-service-polkit) ``` -------------------------------- ### Install QML Module Source: https://github.com/quickshell/quickshell/blob/master/src/wayland/screencopy/CMakeLists.txt Installs the configured QML module for the Wayland screencopy functionality. ```cmake install_qml_module(quickshell-wayland-screencopy) ``` -------------------------------- ### C++ Class Formatting Example Source: https://github.com/quickshell/quickshell/blob/master/HACKING.md Provides a detailed example of class formatting, including Q_OBJECT macro placement, Q_PROPERTY declarations, constructors, member functions, signals, and private members. Follows specific ordering and naming conventions. ```cpp //! Doc comment summary /// Doc comment body class Foo: public QObject { // The Q_OBJECT macro comes first. Macros are ; terminated. Q_OBJECT; QML_ELEMENT; QML_CLASSINFO(...); // Properties must stay on a single line or the doc generator won't be able to pick them up Q_PROPERTY(...); /// Doc comment Q_PROPERTY(...); /// Doc comment Q_PROPERTY(...); public: // Classes should have explicit constructors if they aren't intended to // implicitly cast. The constructor can be inline in the header if it has no body. explicit Foo(QObject* parent = nullptr): QObject(parent) {} // Instance functions if applicable. static Foo* instance(); // Member functions unrelated to properties come next void function(); void function(); void function(); // Then Q_INVOKABLEs Q_INVOKABLE function(); /// Doc comment Q_INVOKABLE function(); /// Doc comment Q_INVOKABLE function(); // Then property related functions, in the order (bindable, getter, setter). // Related functions may be included here as well. Function bodies may be inline // if they are a single expression. There should be a newline between each // property's methods. [[nodiscard]] QBindable bindableFoo() { return &this->bFoo; } [[nodiscard]] T foo() const { return this->foo; } void setFoo(); [[nodiscard]] T bar() const { return this->foo; } void setBar(); signals: // Signals that are not property change related go first. // Property change signals go in property definition order. void asd(); void asd2(); void fooChanged(); void barChanged(); public slots: // generally Q_INVOKABLEs are preferred to public slots. void slot(); private slots: // ... private: // statics, then functions, then fields static const foo BAR; static void foo(); void foo(); void bar(); // property related members are prefixed with `m`. QString mFoo; QString bar; // Bindables go last and should be prefixed with `b`. Q_OBJECT_BINDABLE_PROPERTY(Foo, QString, bFoo, &Foo::fooChanged); }; ``` -------------------------------- ### Install QML Module Source: https://github.com/quickshell/quickshell/blob/master/src/services/mpris/CMakeLists.txt Installs the generated QML module for the MPRIS service. ```cmake install_qml_module(quickshell-service-mpris) ``` -------------------------------- ### Install QML Module Source: https://github.com/quickshell/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/quickshell/blob/master/src/wayland/hyprland/focus_grab/CMakeLists.txt Installs the configured QML module for the Hyprland focus grab component. ```cmake install_qml_module(quickshell-hyprland-focus-grab) ``` -------------------------------- ### Install QML Module Source: https://github.com/quickshell/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/quickshell/blob/master/src/wayland/hyprland/surface/CMakeLists.txt Installs the configured QML module for Hyprland surface extensions. ```cmake install_qml_module(quickshell-hyprland-surface-extensions) ``` -------------------------------- ### Install QML Module Source: https://github.com/quickshell/quickshell/blob/master/src/dbus/dbusmenu/CMakeLists.txt Installs the defined QML module for the D-Bus menu component. ```cmake install_qml_module(quickshell-dbusmenu) ``` -------------------------------- ### Install QML Module Source: https://github.com/quickshell/quickshell/blob/master/src/bluetooth/CMakeLists.txt Installs the defined QML module, making it available for use in QML applications. ```cmake install_qml_module(quickshell-bluetooth) ``` -------------------------------- ### Set QML Module Installation Path Source: https://github.com/quickshell/quickshell/blob/master/BUILD.md Configure the installation path for QML modules. `INSTALL_QML_PREFIX` prepends the CMAKE_INSTALL_PREFIX. ```bash -DINSTALL_QML_PREFIX="path/to/qml" ``` ```bash -DINSTALL_QMLDIR="/full/path/to/qml" ``` -------------------------------- ### Install Hyprland IPC QML Module Source: https://github.com/quickshell/quickshell/blob/master/src/wayland/hyprland/ipc/CMakeLists.txt Installs the configured Hyprland IPC QML module. ```cmake install_qml_module(quickshell-hyprland-ipc) ``` -------------------------------- ### Install Hyprland QML Module Source: https://github.com/quickshell/quickshell/blob/master/src/wayland/hyprland/CMakeLists.txt Installs the configured Hyprland QML module. This makes the module available for use in QML applications. ```cmake install_qml_module(quickshell-hyprland) ``` -------------------------------- ### Build Quickshell Project Source: https://github.com/quickshell/quickshell/blob/master/BUILD.md Execute this command after configuration to build the Quickshell project using CMake. ```sh cmake --build build ``` -------------------------------- ### Add Static Library Source: https://github.com/quickshell/quickshell/blob/master/src/io/CMakeLists.txt Defines a static library target 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 ) ``` -------------------------------- ### Linting Configuration and Execution Source: https://github.com/quickshell/quickshell/blob/master/HACKING.md Shows how to configure the build for linting by disabling precompiled headers and enabling test code paths. Demonstrates the command to run the linter on changed files. ```sh $ just configure debug -DNO_PCH=ON -DBUILD_TESTING=ON $ just lint-changed ``` -------------------------------- ### Create Object Library for Initialization Source: https://github.com/quickshell/quickshell/blob/master/src/window/CMakeLists.txt Creates an object library named 'quickshell-window-init' from 'init.cpp'. Object libraries are typically used for intermediate build steps. ```cmake add_library(quickshell-window-init OBJECT init.cpp) ``` -------------------------------- ### Instantiate Process Test Source: https://github.com/quickshell/quickshell/blob/master/src/io/test/CMakeLists.txt Calls the qs_test function to create and configure the 'process' test executable, specifying its source files. ```cmake qs_test(process process.cpp ../process.cpp ../datastream.cpp ../processcore.cpp) ``` -------------------------------- ### Link Main Target with Window Components Source: https://github.com/quickshell/quickshell/blob/master/src/window/CMakeLists.txt Links the main 'quickshell' target against the 'quickshell-windowplugin' and 'quickshell-window-init' libraries. This integrates the window functionality into the main application. ```cmake target_link_libraries(quickshell PRIVATE quickshell-windowplugin quickshell-window-init) ``` -------------------------------- ### Configure Precompiled Header Set for Launch Source: https://github.com/quickshell/quickshell/blob/master/src/launch/CMakeLists.txt Sets up a precompiled header set named 'launch' for the quickshell project. It specifies dependencies and the header files to be included. ```cmake qs_add_pchset(launch DEPENDENCIES Qt::Core CLI11::CLI11 HEADERS ) ``` -------------------------------- ### Add Static Library Source: https://github.com/quickshell/quickshell/blob/master/src/windowmanager/CMakeLists.txt Defines a static library target named 'quickshell-windowmanager' with specified source files. ```cmake qt_add_library(quickshell-windowmanager STATIC screenprojection.cpp windowmanager.cpp windowset.cpp ) ``` -------------------------------- ### Link Initialization Library to Qml Source: https://github.com/quickshell/quickshell/blob/master/src/window/CMakeLists.txt Links the 'quickshell-window-init' object library against the Qt Qml module. This is necessary for the initialization code to interact with QML. ```cmake target_link_libraries(quickshell-window-init PRIVATE Qt::Qml) ``` -------------------------------- ### Get Git Revision Source: https://github.com/quickshell/quickshell/blob/master/src/build/CMakeLists.txt Executes a Git command to retrieve the current commit hash if the GIT_REVISION variable is not already defined. The output is stripped of trailing whitespace. ```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() ``` -------------------------------- ### Create X11 Init Object Library Source: https://github.com/quickshell/quickshell/blob/master/src/x11/CMakeLists.txt Creates an object library for the X11 initialization code. ```cmake add_library(quickshell-x11-init OBJECT init.cpp) ``` -------------------------------- ### Link Quickshell with Polkit Service Plugin Source: https://github.com/quickshell/quickshell/blob/master/src/services/polkit/CMakeLists.txt Links the main Quickshell executable against the Polkit service plugin. This integrates the Polkit service into the main application. ```cmake target_link_libraries(quickshell PRIVATE quickshell-service-polkitplugin) ``` -------------------------------- ### Link Dependencies for quickshell-launch Source: https://github.com/quickshell/quickshell/blob/master/src/launch/CMakeLists.txt Links necessary libraries to the 'quickshell-launch' target. Includes Qt modules, CLI11 for argument parsing, and the 'quickshell-build' target. ```cmake target_link_libraries(quickshell-launch PRIVATE Qt::Quick Qt::Widgets CLI11::CLI11 quickshell-build ) ``` -------------------------------- ### Link Main Executable to PAM Service Source: https://github.com/quickshell/quickshell/blob/master/src/services/pam/CMakeLists.txt Links the main 'quickshell' executable to the PAM service library. ```cmake target_link_libraries(quickshell PRIVATE quickshell-service-pamplugin) ``` -------------------------------- ### Instantiate Datastream Test Source: https://github.com/quickshell/quickshell/blob/master/src/io/test/CMakeLists.txt Calls the qs_test function to create and configure the 'datastream' test executable, specifying its source files. ```cmake qs_test(datastream datastream.cpp ../datastream.cpp) ``` -------------------------------- ### Link Libraries for Greetd Service Source: https://github.com/quickshell/quickshell/blob/master/src/services/greetd/CMakeLists.txt Links necessary libraries to the greetd service target, including Qt::Quick and quickshell-core. ```cmake # can't be Qt::Qml because generation.hpp pulls in gui types target_link_libraries(quickshell-service-greetd PRIVATE Qt::Quick quickshell-core) ``` -------------------------------- ### Link Polkit Service Library Dependencies Source: https://github.com/quickshell/quickshell/blob/master/src/services/polkit/CMakeLists.txt Links the Polkit service static library against necessary Qt modules and checked PkgConfig packages. This ensures all required functionalities are available. ```cmake target_link_libraries(quickshell-service-polkit PRIVATE Qt::Qml Qt::Quick PkgConfig::glib PkgConfig::gobject PkgConfig::polkit_agent PkgConfig::polkit ) ``` -------------------------------- ### Define quickshell-launch Library Source: https://github.com/quickshell/quickshell/blob/master/src/launch/CMakeLists.txt Defines a static library named 'quickshell-launch' with its source files. This is a core component for the quickshell application's launch functionality. ```cmake qt_add_library(quickshell-launch STATIC parsecommand.cpp command.cpp launch.cpp main.cpp ) ``` -------------------------------- ### Link Greetd Service Plugin to Main Application Source: https://github.com/quickshell/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 Static Library for PipeWire Service Source: https://github.com/quickshell/quickshell/blob/master/src/services/pipewire/CMakeLists.txt Defines a static library target named 'quickshell-service-pipewire' and lists its source files. ```cmake qt_add_library(quickshell-service-pipewire STATIC qml.cpp peak.cpp core.cpp connection.cpp registry.cpp node.cpp metadata.cpp link.cpp device.cpp defaults.cpp ) ``` -------------------------------- ### Add Static Library Source: https://github.com/quickshell/quickshell/blob/master/src/widgets/CMakeLists.txt Defines a static library for the quickshell-widgets. Includes source files for the library. ```cmake qt_add_library(quickshell-widgets STATIC cliprect.cpp wrapper.cpp marginwrapper.cpp ) ``` -------------------------------- ### Link quickshell-launch to quickshell Source: https://github.com/quickshell/quickshell/blob/master/src/launch/CMakeLists.txt Links the 'quickshell-launch' library to the main 'quickshell' target. This makes the launch functionality available to the primary application target. ```cmake target_link_libraries(quickshell PRIVATE quickshell-launch) ``` -------------------------------- ### Create QML Module for PipeWire Service Source: https://github.com/quickshell/quickshell/blob/master/src/services/pipewire/CMakeLists.txt Configures a QML module named 'Quickshell.Services.Pipewire' version 0.1, depending on QtQml. ```cmake qt_add_qml_module(quickshell-service-pipewire URI Quickshell.Services.Pipewire VERSION 0.1 DEPENDENCIES QtQml ) ``` -------------------------------- ### Link Main Application with Layer Shell Plugin Source: https://github.com/quickshell/quickshell/blob/master/src/wayland/wlr_layershell/CMakeLists.txt Links the main 'quickshell-wayland' target with the 'quickshell-wayland-layershellplugin'. ```cmake target_link_libraries(quickshell-wayland PRIVATE quickshell-wayland-layershellplugin) ``` -------------------------------- ### Create Polkit Service Static Library Source: https://github.com/quickshell/quickshell/blob/master/src/services/polkit/CMakeLists.txt Defines a static library for the Polkit service, specifying 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 ) ``` -------------------------------- ### Add Module Dependencies (Light) Source: https://github.com/quickshell/quickshell/blob/master/src/io/CMakeLists.txt Adds light dependencies for the 'quickshell-io' module to the 'Quickshell' module. ```cmake qs_add_module_deps_light(quickshell-io Quickshell) ``` -------------------------------- ### Add Quickshell UI Static Library Source: https://github.com/quickshell/quickshell/blob/master/src/ui/CMakeLists.txt Defines the Quickshell UI as a static library. This is a foundational step for building the UI component. ```cmake qt_add_library(quickshell-ui STATIC reload_popup.cpp ) ``` -------------------------------- ### Apply Precompiled Header to Target Source: https://github.com/quickshell/quickshell/blob/master/src/launch/CMakeLists.txt Applies the precompiled header set named 'launch' to the 'quickshell-launch' target. This optimizes build times by precompiling common headers. ```cmake qs_pch(quickshell-launch SET launch) ``` -------------------------------- ### Instantiate Test Targets Source: https://github.com/quickshell/quickshell/blob/master/src/core/test/CMakeLists.txt These lines instantiate the `qs_test` function to create specific test executables for different components of Quickshell, such as `transformwatcher`, `ringbuffer`, `scriptmodel`, `stacklist`, and `objectmodel`. ```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 for Window Module Source: https://github.com/quickshell/quickshell/blob/master/src/window/CMakeLists.txt Defines a static library named 'quickshell-window' with its source files. This is used to build the core window components. ```cmake qt_add_library(quickshell-window STATIC proxywindow.cpp windowinterface.cpp panelinterface.cpp floatingwindow.cpp popupwindow.cpp ) ``` -------------------------------- ### Link Libraries Source: https://github.com/quickshell/quickshell/blob/master/src/windowmanager/CMakeLists.txt Links the 'quickshell-windowmanager' library with Qt::Quick and links the main 'quickshell' target with 'quickshell-windowmanagerplugin'. ```cmake target_link_libraries(quickshell-windowmanager PRIVATE Qt::Quick) target_link_libraries(quickshell PRIVATE quickshell-windowmanagerplugin) ``` -------------------------------- ### Link Libraries for PipeWire Service Source: https://github.com/quickshell/quickshell/blob/master/src/services/pipewire/CMakeLists.txt Links the 'quickshell-service-pipewire' library against Qt::Qml, PkgConfig::pipewire, and Qt::Quick. ```cmake target_link_libraries(quickshell-service-pipewire PRIVATE Qt::Qml PkgConfig::pipewire Qt::Quick # pch ) ``` -------------------------------- ### Link Libraries Source: https://github.com/quickshell/quickshell/blob/master/src/widgets/CMakeLists.txt Links the quickshell-widgets library to Qt::Quick and the quickshell library to the quickshell-widgetsplugin. ```cmake target_link_libraries(quickshell-widgets PRIVATE Qt::Quick) target_link_libraries(quickshell PRIVATE quickshell-widgetsplugin) ``` -------------------------------- ### Add Light Module Dependencies Source: https://github.com/quickshell/quickshell/blob/master/src/services/pipewire/CMakeLists.txt Adds light dependencies for the 'quickshell-service-pipewire' module to the 'Quickshell' module. ```cmake qs_add_module_deps_light(quickshell-service-pipewire Quickshell) ``` -------------------------------- ### Add QML Module for Greetd Service Source: https://github.com/quickshell/quickshell/blob/master/src/services/greetd/CMakeLists.txt Configures a QML module for the greetd service with a specific URI and version. ```cmake qt_add_qml_module(quickshell-service-greetd URI Quickshell.Services.Greetd VERSION 0.1 DEPENDENCIES QtQml ) ``` -------------------------------- ### Link Plugin Library Source: https://github.com/quickshell/quickshell/blob/master/src/wayland/hyprland/focus_grab/CMakeLists.txt Links the main 'quickshell' target with the 'quickshell-hyprland-focus-grabplugin' library. ```cmake target_link_libraries(quickshell PRIVATE quickshell-hyprland-focus-grabplugin) ``` -------------------------------- ### Add QML Module Source: https://github.com/quickshell/quickshell/blob/master/src/io/CMakeLists.txt Defines a QML module for 'quickshell-io' with a specified URI, version, and QML files. ```cmake qt_add_qml_module(quickshell-io URI Quickshell.Io VERSION 0.1 DEPENDENCIES QtQml QML_FILES FileView.qml ) ``` -------------------------------- ### Create Quickshell Wayland Library Source: https://github.com/quickshell/quickshell/blob/master/src/wayland/CMakeLists.txt Defines a static library for Wayland-specific Quickshell components. Includes linking against dynamic loading libraries and specific Wayland client 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") ``` -------------------------------- ### Configure Precompiled Header for Quickshell Crash Source: https://github.com/quickshell/quickshell/blob/master/src/crash/CMakeLists.txt Sets up precompiled headers for the 'quickshell-crash' library, using the 'large' setting. ```cmake qs_pch(quickshell-crash SET large) ``` -------------------------------- ### Create QML Module for i3 Source: https://github.com/quickshell/quickshell/blob/master/src/x11/i3/CMakeLists.txt Configures a QML module for the 'quickshell-i3' target. This involves setting the URI, version, and importing necessary modules. ```cmake qt_add_qml_module(quickshell-i3 URI Quickshell.I3 VERSION 0.1 IMPORTS ${I3_MODULES} ) ``` -------------------------------- ### Link Bluetooth Plugin to Main Application Source: https://github.com/quickshell/quickshell/blob/master/src/bluetooth/CMakeLists.txt Links the Bluetooth plugin library to the main 'quickshell' executable. ```cmake target_link_libraries(quickshell PRIVATE quickshell-bluetoothplugin) ``` -------------------------------- ### Link Main Quickshell Target Source: https://github.com/quickshell/quickshell/blob/master/src/x11/CMakeLists.txt Links the main Quickshell target with the X11 plugin and init libraries. ```cmake target_link_libraries(quickshell PRIVATE quickshell-x11plugin quickshell-x11-init) ``` -------------------------------- ### Configure Quickshell Build Source: https://github.com/quickshell/quickshell/blob/master/BUILD.md Use this command to configure the build with CMake. Specify the generator (e.g., Ninja), build directory, and build type. Additional disable flags for features can be appended as needed. Ensure dependencies are met or features are disabled. ```sh cmake -GNinja -B build -DCMAKE_BUILD_TYPE=Release [additional disable flags from above here] ``` -------------------------------- ### Create Static Network Library Source: https://github.com/quickshell/quickshell/blob/master/src/network/CMakeLists.txt Defines a static library for the network module, listing its source files. ```cmake qt_add_library(quickshell-network STATIC network.cpp device.cpp wired.cpp wifi.cpp enums.cpp qml.cpp ) ``` -------------------------------- ### Instantiate Test Executables using qs_test Function Source: https://github.com/quickshell/quickshell/blob/master/src/window/test/CMakeLists.txt Calls the `qs_test` function to create and configure test executables for 'popupwindow' and 'windowattached'. Each call specifies the test name and its corresponding source file. ```cmake qs_test(popupwindow popupwindow.cpp) ``` ```cmake qs_test(windowattached windowattached.cpp) ``` -------------------------------- ### Link Quickshell with PipeWire Service Plugin Source: https://github.com/quickshell/quickshell/blob/master/src/services/pipewire/CMakeLists.txt Links the main 'quickshell' target against the 'quickshell-service-pipewireplugin'. ```cmake target_link_libraries(quickshell PRIVATE quickshell-service-pipewireplugin) ``` -------------------------------- ### Link Plugin Library Source: https://github.com/quickshell/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 Static Library for Greetd Service Source: https://github.com/quickshell/quickshell/blob/master/src/services/greetd/CMakeLists.txt Defines a static library for the greetd service, specifying its source files. ```cmake qt_add_library(quickshell-service-greetd STATIC qml.cpp connection.cpp ) ``` -------------------------------- ### Add Module Dependencies Source: https://github.com/quickshell/quickshell/blob/master/src/wayland/hyprland/focus_grab/CMakeLists.txt Specifies light dependencies for the Hyprland focus grab module, linking it with the Quickshell module. ```cmake qs_add_module_deps_light(quickshell-hyprland-focus-grab Quickshell) ``` -------------------------------- ### Create Static Library for D-Bus Menu Source: https://github.com/quickshell/quickshell/blob/master/src/dbus/dbusmenu/CMakeLists.txt Creates a static library for the D-Bus menu component, including source files and generated D-Bus interface definitions. ```cmake qt_add_library(quickshell-dbusmenu STATIC dbus_menu_types.cpp dbusmenu.cpp ${DBUS_INTERFACES} ) ``` -------------------------------- ### Add Static Debug Library Source: https://github.com/quickshell/quickshell/blob/master/src/debug/CMakeLists.txt Defines a static library named 'quickshell-debug' and includes source files for linting. ```cmake qt_add_library(quickshell-debug STATIC lint.cpp ) ``` -------------------------------- ### Add Module Dependencies Source: https://github.com/quickshell/quickshell/blob/master/src/x11/i3/ipc/CMakeLists.txt Specifies light dependencies for the i3 IPC module, including the Quickshell core. ```cmake qs_add_module_deps_light(quickshell-i3-ipc Quickshell) ``` -------------------------------- ### Add Module Dependencies Source: https://github.com/quickshell/quickshell/blob/master/src/windowmanager/CMakeLists.txt Specifies light dependencies for the 'quickshell-windowmanager' module on the 'Quickshell' module. ```cmake qs_add_module_deps_light(quickshell-windowmanager Quickshell) ``` -------------------------------- ### Link Network Plugin to Main Executable Source: https://github.com/quickshell/quickshell/blob/master/src/network/CMakeLists.txt Links the network plugin library to the main 'quickshell' executable. ```cmake target_link_libraries(quickshell PRIVATE quickshell-networkplugin) ``` -------------------------------- ### Link Plugin Library Source: https://github.com/quickshell/quickshell/blob/master/src/x11/i3/CMakeLists.txt Links the main 'quickshell' executable against the 'quickshell-i3plugin' library. This makes the i3 plugin functionality available to the main application. ```cmake target_link_libraries(quickshell PRIVATE quickshell-i3plugin) ``` -------------------------------- ### Add Services Subdirectory Source: https://github.com/quickshell/quickshell/blob/master/src/CMakeLists.txt Includes the services subdirectory. ```cmake add_subdirectory(services) ``` -------------------------------- ### Add Module Dependencies Source: https://github.com/quickshell/quickshell/blob/master/src/wayland/idle_inhibit/CMakeLists.txt Specifies light dependencies for the QML module, linking it with the 'Quickshell' module. ```cmake qs_add_module_deps_light(quickshell-wayland-idle-inhibit Quickshell) ``` -------------------------------- ### Configure Precompiled Header Source: https://github.com/quickshell/quickshell/blob/master/src/wayland/screencopy/wlr_screencopy/CMakeLists.txt Sets up precompiled headers for the wlr screencopy library, configured for large usage. ```cmake qs_pch(quickshell-wayland-screencopy-wlr SET large) ``` -------------------------------- ### Add Polkit Service QML Module Source: https://github.com/quickshell/quickshell/blob/master/src/services/polkit/CMakeLists.txt Configures a QML module for the Polkit service. This makes the service's QML components available to the application. ```cmake qt_add_qml_module(quickshell-service-polkit URI Quickshell.Services.Polkit VERSION 0.1 DEPENDENCIES QtQml ) ``` -------------------------------- ### Check Polkit Dependencies Source: https://github.com/quickshell/quickshell/blob/master/src/services/polkit/CMakeLists.txt Checks for required Polkit and GLib modules using PkgConfig. Ensures necessary libraries are available for Polkit integration. ```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) ``` -------------------------------- ### Add Static Library for Wlr Screencopy Source: https://github.com/quickshell/quickshell/blob/master/src/wayland/screencopy/wlr_screencopy/CMakeLists.txt Defines a static library named 'quickshell-wayland-screencopy-wlr' using the 'wlr_screencopy.cpp' source file. ```cmake qt_add_library(quickshell-wayland-screencopy-wlr STATIC wlr_screencopy.cpp ) ``` -------------------------------- ### Link Libraries for i3 IPC Source: https://github.com/quickshell/quickshell/blob/master/src/x11/i3/ipc/CMakeLists.txt Links the i3 IPC static library with Qt::Quick and the quickshell-core library. ```cmake target_link_libraries(quickshell-i3-ipc PRIVATE Qt::Quick quickshell-core) ``` -------------------------------- ### Add Module Dependencies Source: https://github.com/quickshell/quickshell/blob/master/src/dbus/dbusmenu/CMakeLists.txt Adds light dependencies for the D-Bus menu module to the Quickshell project. ```cmake qs_add_module_deps_light(quickshell-dbusmenu Quickshell) ``` -------------------------------- ### Add Static Library Source: https://github.com/quickshell/quickshell/blob/master/src/wayland/idle_inhibit/CMakeLists.txt Defines a static library named 'quickshell-wayland-idle-inhibit' with specified source files. ```cmake qt_add_library(quickshell-wayland-idle-inhibit STATIC proto.cpp inhibitor.cpp ) ``` -------------------------------- ### Link Qt Dependencies Source: https://github.com/quickshell/quickshell/blob/master/src/x11/i3/CMakeLists.txt Links the 'quickshell-i3' library against specified Qt dependencies. This ensures that all necessary Qt modules are available during the build process. ```cmake target_link_libraries(quickshell-i3 PRIVATE ${QT_DEPS}) ``` -------------------------------- ### Link X11 Libraries Source: https://github.com/quickshell/quickshell/blob/master/src/x11/CMakeLists.txt Links necessary libraries for the X11 static library and the init object library. ```cmake target_link_libraries(quickshell-x11 PRIVATE Qt::Quick ${XCB_LIBRARIES}) target_link_libraries(quickshell-x11-init PRIVATE Qt::Quick Qt::Qml ${XCB_LIBRARIES}) ``` -------------------------------- ### Link Global Shortcuts Plugin to Main Executable Source: https://github.com/quickshell/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) ``` -------------------------------- ### Add Module Dependencies Source: https://github.com/quickshell/quickshell/blob/master/src/wayland/shortcuts_inhibit/CMakeLists.txt Adds light dependencies for the QML module, linking it to the 'Quickshell' module. ```cmake qs_add_module_deps_light(quickshell-wayland-shortcuts-inhibit Quickshell) ``` -------------------------------- ### Add Quickshell Core Static Library Source: https://github.com/quickshell/quickshell/blob/master/src/core/CMakeLists.txt Defines the static library 'quickshell-core' and lists its source files. This library contains the core C++ components of Quickshell. ```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 ) ``` -------------------------------- ### Configure Precompiled Header Source: https://github.com/quickshell/quickshell/blob/master/src/wayland/session_lock/CMakeLists.txt Sets up a precompiled header for the quickshell-wayland-sessionlock target, configured for large PCH settings. ```cmake qs_pch(quickshell-wayland-sessionlock SET large) ``` -------------------------------- ### Add QML Module Source: https://github.com/quickshell/quickshell/blob/master/src/network/CMakeLists.txt Configures the network library as a QML module with a specific URI and version. ```cmake qt_add_qml_module(quickshell-network URI Quickshell.Networking VERSION 0.1 DEPENDENCIES QtQml ) ``` -------------------------------- ### Link Libraries for D-Bus Menu Source: https://github.com/quickshell/quickshell/blob/master/src/dbus/dbusmenu/CMakeLists.txt Links the D-Bus menu library against Qt Quick and Qt DBus, and adds specific Quickshell link dependencies. ```cmake target_link_libraries(quickshell-dbusmenu PRIVATE Qt::Quick Qt::DBus) qs_add_link_dependencies(quickshell-dbusmenu quickshell-dbus) ``` -------------------------------- ### Find and Check PipeWire Package Source: https://github.com/quickshell/quickshell/blob/master/src/services/pipewire/CMakeLists.txt Uses PkgConfig to find and check for the libpipewire-0.3 library, making its targets available for linking. ```cmake find_package(PkgConfig REQUIRED) pkg_check_modules(pipewire REQUIRED IMPORTED_TARGET libpipewire-0.3) ``` -------------------------------- ### Link Libraries for PAM Service Source: https://github.com/quickshell/quickshell/blob/master/src/services/pam/CMakeLists.txt Links necessary libraries to the PAM service static library, including Qt modules and PAM. ```cmake target_link_libraries(quickshell-service-pam PRIVATE Qt::Qml pam ${PAM_LIBRARIES} Qt::Quick # pch ) ``` -------------------------------- ### Add Light Module Dependencies Source: https://github.com/quickshell/quickshell/blob/master/src/window/CMakeLists.txt Specifies light dependencies for the 'quickshell-window' module, linking it to the 'Quickshell' module. This is a custom macro for managing module interdependencies. ```cmake qs_add_module_deps_light(quickshell-window Quickshell) ``` -------------------------------- ### Add QML Module Source: https://github.com/quickshell/quickshell/blob/master/src/wayland/shortcuts_inhibit/CMakeLists.txt Configures a QML module for the Wayland shortcuts inhibitor, specifying URI, version, and dependencies. ```cmake qt_add_qml_module(quickshell-wayland-shortcuts-inhibit URI Quickshell.Wayland._ShortcutsInhibitor VERSION 0.1 DEPENDENCIES QtQuick ) ``` -------------------------------- ### Optional Jemalloc Dependency Source: https://github.com/quickshell/quickshell/blob/master/CMakeLists.txt Checks for jemalloc using PkgConfig and links it to the 'quickshell' target if USE_JEMALLOC is enabled. Note: IMPORTED_TARGET was not working. ```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() ``` -------------------------------- ### Find Qt6 Package Source: https://github.com/quickshell/quickshell/blob/master/CMakeLists.txt Finds and configures the Qt6 package, requiring specified components. ```cmake find_package(Qt6 REQUIRED COMPONENTS ${QT_FPDEPS}) ``` -------------------------------- ### Add QML Module Source: https://github.com/quickshell/quickshell/blob/master/src/widgets/CMakeLists.txt Configures a QML module for the quickshell-widgets library. Specifies the URI, version, and QML files included in the module. ```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 ) ``` -------------------------------- ### Link Screencopy Plugin to Main Target Source: https://github.com/quickshell/quickshell/blob/master/src/wayland/screencopy/CMakeLists.txt Links the main 'quickshell' target against the 'quickshell-wayland-screencopyplugin' to enable screencopy functionality. ```cmake target_link_libraries(quickshell PRIVATE quickshell-wayland-screencopyplugin) ``` -------------------------------- ### Set Include Directories for D-Bus Headers Source: https://github.com/quickshell/quickshell/blob/master/src/bluetooth/CMakeLists.txt Configures private include directories for the Bluetooth library to include generated D-Bus headers. ```cmake target_include_directories(quickshell-bluetooth PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) ``` -------------------------------- ### Define Qt Dependencies Source: https://github.com/quickshell/quickshell/blob/master/CMakeLists.txt Lists the required Qt modules for the project, including core, GUI, QML, and private modules. ```cmake set(QT_FPDEPS Gui Qml Quick QuickControls2 Widgets ShaderTools) set(QT_PRIVDEPS QuickPrivate) ``` -------------------------------- ### Link Toplevel Management Plugin to Main Executable Source: https://github.com/quickshell/quickshell/blob/master/src/wayland/toplevel/CMakeLists.txt Links the Wayland toplevel management plugin library to the main Quickshell executable. ```cmake target_link_libraries(quickshell PRIVATE quickshell-wayland-toplevel-managementplugin) ``` -------------------------------- ### Add Static Library for IPC Source: https://github.com/quickshell/quickshell/blob/master/src/ipc/CMakeLists.txt Defines the quickshell-ipc library as a static library and lists its source files. ```cmake qt_add_library(quickshell-ipc STATIC ipc.cpp ) ``` -------------------------------- ### Link Hyprland IPC Library Source: https://github.com/quickshell/quickshell/blob/master/src/wayland/hyprland/ipc/CMakeLists.txt Links the Hyprland IPC static library against Qt Quick and the Quickshell core library. ```cmake target_link_libraries(quickshell-hyprland-ipc PRIVATE Qt::Quick quickshell-core) ``` -------------------------------- ### Add QML Module Source: https://github.com/quickshell/quickshell/blob/master/src/wayland/idle_inhibit/CMakeLists.txt Configures a QML module for the 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 ) ``` -------------------------------- ### Link Session Lock Library Dependencies Source: https://github.com/quickshell/quickshell/blob/master/src/wayland/session_lock/CMakeLists.txt Links the quickshell-wayland-sessionlock library against necessary Qt modules, Wayland client libraries, and the defined Wayland protocol. ```cmake target_link_libraries(quickshell-wayland-sessionlock PRIVATE Qt::Quick Qt::WaylandClient Qt::WaylandClientPrivate wayland-client wlp-session-lock ) ``` -------------------------------- ### Integrate Wayland Protocol Source: https://github.com/quickshell/quickshell/blob/master/src/wayland/hyprland/global_shortcuts/CMakeLists.txt Integrates the Wayland protocol for Hyprland global shortcuts. ```cmake wl_proto(wlp-hyprland-shortcuts hyprland-global-shortcuts-v1 "${CMAKE_CURRENT_SOURCE_DIR}") ``` -------------------------------- ### Define PAM Service Static Library Source: https://github.com/quickshell/quickshell/blob/master/src/services/pam/CMakeLists.txt Defines a static library for the PAM service, listing its source files. ```cmake qt_add_library(quickshell-service-pam STATIC qml.cpp conversation.cpp ipc.cpp subprocess.cpp ) ``` -------------------------------- ### Add Include Directory to Target Source: https://github.com/quickshell/quickshell/blob/master/src/build/CMakeLists.txt Adds the binary directory to the include path for the 'quickshell-build' target. This allows the target to find headers generated during the build process. ```cmake target_include_directories(quickshell-build INTERFACE ${CMAKE_CURRENT_BINARY_DIR}) ``` -------------------------------- ### Configure Precompiled Header Source: https://github.com/quickshell/quickshell/blob/master/src/ipc/CMakeLists.txt Enables precompiled header support for the quickshell-ipc library. ```cmake qs_pch(quickshell-ipc) ``` -------------------------------- ### Find Wayland Dependencies Source: https://github.com/quickshell/quickshell/blob/master/src/wayland/CMakeLists.txt Locates necessary Wayland and PkgConfig modules. Ensures WaylandScanner and Qt6::qtwaylandscanner are available. ```cmake find_package(PkgConfig REQUIRED) find_package(WaylandScanner REQUIRED) pkg_check_modules(wayland REQUIRED IMPORTED_TARGET wayland-client wayland-protocols>=1.41) ``` -------------------------------- ### Add Light Module Dependencies Source: https://github.com/quickshell/quickshell/blob/master/src/services/mpris/CMakeLists.txt Adds light dependencies for the MPRIS service module, linking it to the main Quickshell module. ```cmake qs_add_module_deps_light(quickshell-service-mpris Quickshell) ``` -------------------------------- ### Authenticate with Fingerprint then Password Source: https://github.com/quickshell/quickshell/blob/master/src/services/pam/module.md This configuration attempts fingerprint authentication first. If it fails, it falls back to password authentication. ```plaintext auth sufficient pam_fprintd.so auth required pam_unix.so ``` -------------------------------- ### Add QML Module Source: https://github.com/quickshell/quickshell/blob/master/src/wayland/hyprland/global_shortcuts/CMakeLists.txt Configures a QML module for the Hyprland global shortcuts, specifying its URI, version, and dependencies. ```cmake qt_add_qml_module(quickshell-hyprland-global-shortcuts URI Quickshell.Hyprland._GlobalShortcuts VERSION 0.1 DEPENDENCIES QtQml ) ``` -------------------------------- ### Link Libraries for Background Effect Source: https://github.com/quickshell/quickshell/blob/master/src/wayland/background_effect/CMakeLists.txt Links the necessary Qt and Wayland client libraries to the background effect static library. ```cmake target_link_libraries(quickshell-wayland-background-effect PRIVATE Qt::Quick Qt::WaylandClient Qt::WaylandClientPrivate wayland-client wlp-background-effect ) ``` -------------------------------- ### Link Qt::Quick Dependency Source: https://github.com/quickshell/quickshell/blob/master/src/debug/CMakeLists.txt Links the 'quickshell-debug' library against the Qt::Quick module for Qt Quick functionality. ```cmake target_link_libraries(quickshell-debug PRIVATE Qt::Quick) ``` -------------------------------- ### Define Static Library for Idle Notify Source: https://github.com/quickshell/quickshell/blob/master/src/wayland/idle_notify/CMakeLists.txt Defines a static library named 'quickshell-wayland-idle-notify' with specified source files. ```cmake qt_add_library(quickshell-wayland-idle-notify STATIC proto.cpp monitor.cpp ) ``` -------------------------------- ### Link Main Quickshell Library Source: https://github.com/quickshell/quickshell/blob/master/src/wayland/hyprland/ipc/CMakeLists.txt Links the main Quickshell library against the Hyprland IPC plugin library. ```cmake target_link_libraries(quickshell PRIVATE quickshell-hyprland-ipcplugin) ``` -------------------------------- ### Link Libraries for Quickshell Crash Source: https://github.com/quickshell/quickshell/blob/master/src/crash/CMakeLists.txt Links the 'quickshell-crash' target with necessary libraries 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) ``` -------------------------------- ### Link Libraries for Static Library Source: https://github.com/quickshell/quickshell/blob/master/src/wayland/shortcuts_inhibit/CMakeLists.txt Links necessary libraries to the static library, including Qt modules, Wayland client, and the defined protocol. ```cmake target_link_libraries(quickshell-wayland-shortcuts-inhibit PRIVATE Qt::Quick Qt::WaylandClient Qt::WaylandClientPrivate wayland-client wlp-shortcuts-inhibit ) ``` -------------------------------- ### Define X11 Library Source: https://github.com/quickshell/quickshell/blob/master/src/x11/CMakeLists.txt Defines a static library for X11 related components. Requires XCB components. ```cmake find_package(XCB REQUIRED COMPONENTS XCB) qt_add_library(quickshell-x11 STATIC util.cpp panel_window.cpp ) ``` -------------------------------- ### Define Quickshell Crash Static Library Source: https://github.com/quickshell/quickshell/blob/master/src/crash/CMakeLists.txt Defines the static library 'quickshell-crash' and lists its source files. ```cmake qt_add_library(quickshell-crash STATIC main.cpp interface.cpp handler.cpp ) ``` -------------------------------- ### Add Module Dependencies Source: https://github.com/quickshell/quickshell/blob/master/src/wayland/idle_notify/CMakeLists.txt Adds light dependencies for the idle notify module, specifically to the 'Quickshell' module. ```cmake qs_add_module_deps_light(quickshell-wayland-idle-notify Quickshell) ``` -------------------------------- ### Define Project and Minimum CMake Version Source: https://github.com/quickshell/quickshell/blob/master/CMakeLists.txt Sets the minimum required CMake version and defines the project name, version, and languages. ```cmake cmake_minimum_required(VERSION 3.20) project(quickshell VERSION "0.3.0" LANGUAGES CXX C) ``` -------------------------------- ### Generate Precompiled Headers Source: https://github.com/quickshell/quickshell/blob/master/src/x11/i3/CMakeLists.txt Generates precompiled headers for the 'quickshell-i3' and 'quickshell-i3plugin' targets. This can improve build times by caching compilation of frequently used headers. ```cmake qs_pch(quickshell-i3) qs_pch(quickshell-i3plugin) ``` -------------------------------- ### Link Plugin Library Source: https://github.com/quickshell/quickshell/blob/master/src/wayland/shortcuts_inhibit/CMakeLists.txt Links the main 'quickshell' target to the 'quickshell-wayland-shortcuts-inhibitplugin' library. ```cmake target_link_libraries(quickshell PRIVATE quickshell-wayland-shortcuts-inhibitplugin) ``` -------------------------------- ### Link Quickshell Wayland Libraries Source: https://github.com/quickshell/quickshell/blob/master/src/wayland/CMakeLists.txt Links the main Quickshell library and its initialization object against the Wayland components and Qt Quick modules. This ensures Wayland functionality is available to the application. ```cmake # 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) ``` -------------------------------- ### Link Libraries Source: https://github.com/quickshell/quickshell/blob/master/src/wayland/hyprland/focus_grab/CMakeLists.txt Links the Hyprland focus grab library with necessary Qt and Wayland libraries, including the defined Wayland protocol. ```cmake target_link_libraries(quickshell-hyprland-focus-grab PRIVATE Qt::Quick Qt::WaylandClient Qt::WaylandClientPrivate wayland-client wlp-hyprland-focus-grab ) ``` -------------------------------- ### Link Window Library to Qt Modules Source: https://github.com/quickshell/quickshell/blob/master/src/window/CMakeLists.txt Links the 'quickshell-window' library against essential Qt modules (Core, Gui, Quick) and the Qt Quick Private module. This ensures the window components have access to necessary Qt functionalities. ```cmake target_link_libraries(quickshell-window PRIVATE Qt::Core Qt::Gui Qt::Quick Qt6::QuickPrivate ) ``` -------------------------------- ### Link Libraries for Wayland Toplevel Management Source: https://github.com/quickshell/quickshell/blob/master/src/wayland/toplevel/CMakeLists.txt Links necessary Qt and Wayland libraries to the Wayland toplevel management static library. ```cmake target_link_libraries(quickshell-wayland-toplevel-management PRIVATE Qt::Quick Qt::WaylandClient Qt::WaylandClientPrivate wayland-client wlp-foreign-toplevel ) ``` -------------------------------- ### Link Qt Dependencies Source: https://github.com/quickshell/quickshell/blob/master/src/wayland/hyprland/CMakeLists.txt Links the necessary Qt dependencies to the Hyprland library. Ensures all required Qt components are available. ```cmake target_link_libraries(quickshell-hyprland PRIVATE ${QT_DEPS}) ``` -------------------------------- ### Enable Testing and Define Test Macro Source: https://github.com/quickshell/quickshell/blob/master/CMakeLists.txt Enables testing if the BUILD_TESTING option is ON and defines the QS_TEST preprocessor macro. Also adds the 'Test' module to Qt dependencies. ```cmake if (BUILD_TESTING) enable_testing() add_definitions(-DQS_TEST) list(APPEND QT_FPDEPS Test) endif() ``` -------------------------------- ### Add X11 QML Module Source: https://github.com/quickshell/quickshell/blob/master/src/x11/CMakeLists.txt Configures a QML module for X11 integration, specifying URI, version, and dependencies. ```cmake qt_add_qml_module(quickshell-x11 URI Quickshell.X11 VERSION 0.1 DEPENDENCIES QtQuick ) ``` -------------------------------- ### Add QML Module for Window Source: https://github.com/quickshell/quickshell/blob/master/src/window/CMakeLists.txt Registers 'quickshell-window' as a QML module with a specific URI and version. This makes its QML types available to other parts of the application. ```cmake qt_add_qml_module(quickshell-window URI Quickshell._Window VERSION 0.1 DEPENDENCIES QtQuick ) ``` -------------------------------- ### Link Background Effect Plugin to Quickshell Source: https://github.com/quickshell/quickshell/blob/master/src/wayland/background_effect/CMakeLists.txt Links the Wayland background effect plugin to the main Quickshell executable. ```cmake target_link_libraries(quickshell PRIVATE quickshell-wayland-background-effectplugin) ``` -------------------------------- ### Link Private Dependencies Source: https://github.com/quickshell/quickshell/blob/master/src/wayland/screencopy/wlr_screencopy/CMakeLists.txt Links private dependencies for the wlr screencopy library, including Wayland client libraries and Qt Quick for precompiled headers. ```cmake target_link_libraries(quickshell-wayland-screencopy-wlr PRIVATE Qt::WaylandClient Qt::WaylandClientPrivate wayland-client Qt::Quick # for pch ) ``` -------------------------------- ### Link Quickshell with i3 IPC Plugin Source: https://github.com/quickshell/quickshell/blob/master/src/x11/i3/ipc/CMakeLists.txt Links the main Quickshell target with the i3 IPC plugin library. ```cmake target_link_libraries(quickshell PRIVATE quickshell-i3-ipcplugin) ``` -------------------------------- ### Link Libraries for IPC Source: https://github.com/quickshell/quickshell/blob/master/src/ipc/CMakeLists.txt Links the quickshell-ipc library with Qt Quick and Qt Network modules, and links the main quickshell target with the quickshell-ipc library. ```cmake target_link_libraries(quickshell-ipc PRIVATE Qt::Quick Qt::Network) target_link_libraries(quickshell PRIVATE quickshell-ipc) ``` -------------------------------- ### Add PAM Service QML Module Source: https://github.com/quickshell/quickshell/blob/master/src/services/pam/CMakeLists.txt Registers the PAM service as a QML module with a specific URI and version. ```cmake qt_add_qml_module(quickshell-service-pam URI Quickshell.Services.Pam VERSION 0.1 DEPENDENCIES QtQml ) ``` -------------------------------- ### Link Quickshell Executable with Core Plugin Source: https://github.com/quickshell/quickshell/blob/master/src/core/CMakeLists.txt Links the main 'quickshell' executable target against the 'quickshell-coreplugin' library. ```cmake target_link_libraries(quickshell PRIVATE quickshell-coreplugin) ``` -------------------------------- ### Link Quickshell with Surface Extensions Plugin Source: https://github.com/quickshell/quickshell/blob/master/src/wayland/hyprland/surface/CMakeLists.txt Links the main Quickshell target with the Hyprland surface extensions plugin. ```cmake target_link_libraries(quickshell PRIVATE quickshell-hyprland-surface-extensionsplugin) ``` -------------------------------- ### Define Static Library for i3 Source: https://github.com/quickshell/quickshell/blob/master/src/x11/i3/CMakeLists.txt Defines a static library target named 'quickshell-i3'. This is a common practice for organizing code into reusable modules. ```cmake qt_add_library(quickshell-i3 STATIC) ``` -------------------------------- ### Link Main Project to Idle Notify Plugin Source: https://github.com/quickshell/quickshell/blob/master/src/wayland/idle_notify/CMakeLists.txt Links the main 'quickshell' project to the 'quickshell-wayland-idle-notifyplugin'. ```cmake target_link_libraries(quickshell PRIVATE quickshell-wayland-idle-notifyplugin) ``` -------------------------------- ### Generate Precompiled Headers Source: https://github.com/quickshell/quickshell/blob/master/src/services/greetd/CMakeLists.txt Generates precompiled headers for the greetd service target. ```cmake qs_module_pch(quickshell-service-greetd) ``` -------------------------------- ### Create Hyprland QML Module Source: https://github.com/quickshell/quickshell/blob/master/src/wayland/hyprland/CMakeLists.txt Configures the Hyprland module as a QML module with a specified URI and version. It imports the conditionally added Hyprland modules. ```cmake qt_add_qml_module(quickshell-hyprland URI Quickshell.Hyprland VERSION 0.1 IMPORTS ${HYPRLAND_MODULES} ) ``` -------------------------------- ### Link Libraries for Quickshell Core Source: https://github.com/quickshell/quickshell/blob/master/src/core/CMakeLists.txt Links the 'quickshell-core' library against Qt modules (Quick, QuickPrivate, Widgets), the 'quickshell-build' target, and the 'libdrm' package. ```cmake target_link_libraries(quickshell-core PRIVATE Qt::Quick Qt::QuickPrivate Qt::Widgets quickshell-build PkgConfig::libdrm) ``` -------------------------------- ### Add Static Library for Bluetooth Source: https://github.com/quickshell/quickshell/blob/master/src/bluetooth/CMakeLists.txt Creates a static library for the Bluetooth module, linking source files and D-Bus interfaces. ```cmake qt_add_library(quickshell-bluetooth STATIC adapter.cpp bluez.cpp device.cpp ${DBUS_INTERFACES} ) ``` -------------------------------- ### Link Main Quickshell Target Source: https://github.com/quickshell/quickshell/blob/master/src/wayland/idle_inhibit/CMakeLists.txt Links the main 'quickshell' target against the 'quickshell-wayland-idle-inhibitplugin'. ```cmake target_link_libraries(quickshell PRIVATE quickshell-wayland-idle-inhibitplugin) ``` -------------------------------- ### Link Hyprland Plugin to Main Executable Source: https://github.com/quickshell/quickshell/blob/master/src/wayland/hyprland/CMakeLists.txt Links the quickshell-hyprlandplugin to the main quickshell executable. This integrates the Hyprland module's functionality into the primary application. ```cmake target_link_libraries(quickshell PRIVATE quickshell-hyprlandplugin) ``` -------------------------------- ### Add Network Subdirectory Source: https://github.com/quickshell/quickshell/blob/master/src/network/CMakeLists.txt Includes the 'nm' subdirectory for further build configuration. ```cmake add_subdirectory(nm) ```