-
Notifications
You must be signed in to change notification settings - Fork 37
Building
| Dependency | Version | Notes |
|---|---|---|
| π§ CMake | >= 3.22 | Build system |
| β‘ Ninja | any | Recommended generator (make works too) |
| π» C++ compiler | C++20 | GCC 12+ or Clang 15+ |
| π¨ Qt 6 | >= 6.4 | Core, Quick, Svg, DBus, Widgets, Concurrent, Test, QuickTest |
| π libudev | any | Device discovery via udev/hidraw |
| π§ͺ Google Test | any | Test framework (Ubuntu ships source only β needs manual build) |
| π¦ pkg-config | any | Finds libudev |
The project uses these Qt 6 modules (from CMakeLists.txt):
find_package(Qt6 REQUIRED COMPONENTS Core Quick Svg DBus Widgets Concurrent Test QuickTest)
Plus these QML modules at runtime:
-
qml6-module-qtquick,qml6-module-qtquick-controls,qml6-module-qtquick-layouts -
qml6-module-qtquick-window,qml6-module-qtquick-templates -
qml6-module-qtquick-dialogs,qml6-module-qt5compat-graphicaleffects -
qml6-module-qttest(for QML tests)
sudo apt-get install -y \ build-essential cmake ninja-build pkg-config \ qt6-base-dev qt6-declarative-dev qt6-svg-dev \ qt6-tools-dev qt6-tools-dev-tools qt6-l10n-tools \ qml6-module-qtquick qml6-module-qtquick-controls \ qml6-module-qtquick-layouts qml6-module-qtquick-window \ qml6-module-qtquick-templates qml6-module-qtqml-workerscript \ qml6-module-qtquick-dialogs qml6-module-qt5compat-graphicaleffects \ qt6-qpa-plugins libqt6opengl6-dev libqt6svg6-dev \ libqt6dbus6 libqt6widgets6 libxkbcommon-dev \ qml6-module-qttest libudev-dev libgtest-dev # Build and install GTest (Ubuntu ships source only) cd /usr/src/googletest && sudo cmake -B build && sudo cmake --build build && sudo cmake --install build
sudo pacman -S cmake ninja qt6-base qt6-declarative qt6-svg qt6-tools \ qt6-5compat gtest libudev0-shim pkgconf
git clone https://github.com/logitune/logitune.git cd logitune # Configure + build make build # Run with debug logging make run
The make build target runs:
cmake -B build -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -Wno-dev
cmake --build build -j$(nproc)The Makefile provides these targets:
| Command | Description |
|---|---|
make build |
π¨ Build the project (Debug mode) |
make run |
--debug (host only) |
make test |
π§ͺ Run C++ unit/integration tests |
make test-qml |
π¨ Run QML component tests |
make test-tray |
π Run tray manager tests |
make test-all |
β Run all test tiers |
make flatpak-setup |
π Install Flatpak SDK (first time, ~2GB) |
make flatpak |
π¦ Build and install Flatpak |
make release |
π·οΈ Version bump, tag, Flatpak, GitHub release |
make setup-hooks |
πͺ Install git pre-push hook |
make clean |
π§Ή Remove build artifacts |
make help |
β Show all targets |
| Option | Default | Description |
|---|---|---|
BUILD_TESTING |
ON |
Build test binaries |
BUILD_HW_TESTING |
OFF |
Build hardware integration tests (requires connected device) |
CMAKE_BUILD_TYPE |
Debug |
Debug or Release
|
logitune/
βββ CMakeLists.txt # Root CMake β project, Qt find, subdirs
βββ Makefile # Developer convenience targets
βββ com.logitune.Logitune.yml # Flatpak manifest
βββ data/
β βββ 71-logitune.rules # udev rules for hidraw + uinput
β βββ com.logitune.Logitune.desktop
β βββ com.logitune.Logitune.metainfo.xml
β βββ com.logitune.Logitune.svg
βββ src/
β βββ core/ # Static library: logitune-core
β β βββ CMakeLists.txt
β β βββ DeviceManager.cpp/h # Device lifecycle, HID++ orchestration
β β βββ DeviceRegistry.cpp/h
β β βββ ProfileEngine.cpp/h # Profile CRUD, app bindings, cache
β β βββ ActionExecutor.cpp/h
β β βββ ButtonAction.h
β β βββ hidpp/ # HID++ protocol layer
β β β βββ HidppTypes.h # Report, FeatureId, ErrorCode
β β β βββ HidrawDevice.h # Raw hidraw fd wrapper
β β β βββ Transport.h # Send/receive with timeout + retry
β β β βββ FeatureDispatcher.h # Feature table, call(), callAsync()
β β β βββ CommandQueue.h # Paced sequential command sending
β β β βββ features/ # Per-feature param builders + parsers
β β βββ devices/
β β β βββ MxMaster3sDescriptor.cpp/h
β β βββ interfaces/
β β β βββ IDevice.h # Device descriptor interface
β β β βββ IDesktopIntegration.h
β β β βββ IInputInjector.h
β β β βββ ITransport.h
β β βββ desktop/
β β β βββ KDeDesktop.cpp/h # KDE/KWin integration
β β β βββ GenericDesktop.cpp/h
β β βββ input/
β β β βββ UinputInjector.cpp/h
β β βββ logging/
β β βββ LogManager.cpp/h
β β βββ CrashHandler.cpp/h
β βββ app/ # Static library: logitune-app-lib + executable
β βββ CMakeLists.txt
β βββ main.cpp # Entry point, QML engine, tray
β βββ AppController.cpp/h # Main orchestrator
β βββ TrayManager.cpp/h
β βββ models/
β β βββ DeviceModel.h # QML-facing device state
β β βββ ButtonModel.h # QAbstractListModel for buttons
β β βββ ActionModel.h # Available actions catalog
β β βββ ProfileModel.h # Profile tabs
β βββ dialogs/
β β βββ CrashReportDialog.cpp/h
β β βββ GitHubIssueBuilder.cpp/h
β βββ qml/
β βββ Main.qml
β βββ Theme.qml # Singleton with design tokens
β βββ HomeView.qml
β βββ DeviceView.qml
β βββ pages/ # PointScrollPage, ButtonsPage, EasySwitchPage, SettingsPage
β βββ components/ # SideNav, BatteryChip, DeviceRender, etc.
β βββ assets/ # Device images (PNG)
βββ tests/
β βββ CMakeLists.txt
β βββ test_main.cpp # GTest main with QCoreApplication
β βββ helpers/
β β βββ TestFixtures.h # ProfileFixture, ensureApp()
β β βββ AppControllerFixture.h # Full integration test fixture
β βββ mocks/
β β βββ MockDesktop.h/cpp
β β βββ MockTransport.h/cpp
β β βββ MockInjector.h/cpp
β β βββ MockDevice.h
β βββ test_*.cpp # C++ test files
β βββ qml/
β β βββ tst_*.qml # QML component tests
β β βββ tst_qml_main.cpp
β βββ hw/
β βββ HardwareFixture.h
β βββ hw_test_main.cpp
β βββ test_hw_*.cpp # Hardware integration tests
βββ scripts/
β βββ pre-push # Git hook: run all tests before push
β βββ release.sh
βββ .github/workflows/
βββ ci.yml # Build + test on push/PR
βββ release.yml # Flatpak bundle on tag push
make flatpak-setup
Note
This installs the Flathub remote and the KDE Platform/SDK 6.10 runtime (~2GB download).
On host (builds and installs locally):
make flatpak
In devcontainer (build only β no user session):
make flatpak
The Flatpak manifest (com.logitune.Logitune.yml) configures:
| Setting | Value |
|---|---|
| π₯οΈ Runtime |
org.kde.Platform 6.10 |
| π D-Bus | Talks to org.kde.KWin and org.kde.kglobalaccel, owns com.logitune.app
|
| π Device access |
--device=all for hidraw |
| π Host filesystem | Read-only access to host .desktop files for the app profile picker |
| πΎ Config persistence |
~/.config/Logitune and ~/.local/share/Logitune shared between host and sandbox |
The repository includes a devcontainer configuration for one-click development in VS Code or GitHub Codespaces.
The Dockerfile (/.devcontainer/Dockerfile) builds an Ubuntu 24.04 container with:
- β All build dependencies (Qt 6, CMake, Ninja, GTest, libudev)
- β Development tools (clangd, gdb, fish shell, bat, eza, ripgrep, fzf)
- β Flatpak builder
- β Nerd Font for terminal icons
- β
QT_QPA_PLATFORM=offscreenfor headless testing
The devcontainer auto-installs:
| Extension | Purpose |
|---|---|
llvm-vs-code-extensions.vscode-clangd |
C++ language server |
ms-vscode.cmake-tools |
CMake integration |
theqtcompany.qt / qt-qml / qt-cpp
|
Qt/QML support |
vscode-icons-team.vscode-icons |
File icons |
On container creation, postCreateCommand runs:
make setup-hooks
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
cmake --build build -j$(nproc)Tip
The project is fully built and ready to test immediately after the container starts.
Warning
The devcontainer runs headless (QT_QPA_PLATFORM=offscreen), so:
- β All tests run fine (C++, QML, tray)
- β You cannot run the GUI application visually
- β No hidraw access (no physical device tests)
The CI workflow (.github/workflows/ci.yml) runs on every push to master and every pull request:
graph LR
A[Push / PR] --> B[Install Dependencies]
B --> C[Configure CMake]
C --> D[Build]
D --> E[C++ Tests]
D --> F[Tray Tests]
D --> G[QML Tests]
E --> H{All Pass?}
F --> H
G --> H
The release workflow (.github/workflows/release.yml) triggers on version tags (v*):
graph LR
A[Tag Push v*] --> B[Install Flatpak Builder]
B --> C[Install KDE SDK 6.10]
C --> D[flatpak-builder]
D --> E[Create Bundle]
E --> F[GitHub Release]
Note
The release workflow builds a .flatpak bundle and creates a GitHub Release with auto-generated release notes.