Linux project
Create a ready-to-build embedded Linux project from the LVGL Pro Editor launcher, with DRM/KMS, framebuffer, SDL2, Wayland, and X11 backends.
This feature requires LVGL Pro Editor v2.0 or higher.
The Editor can generate a complete, ready-to-build Linux project for you — the same way it creates a Zephyr project or a VS Code project. The primary target is embedded Linux (it ships DRM/KMS and framebuffer backends for boards), but it also runs on desktop Linux via SDL2, Wayland, or X11, so you can develop and iterate without hardware.
LVGL itself is downloaded automatically by CMake, so there's nothing to clone or wire up by hand. Your UI is exported into the project's ui/ folder and picked up automatically.
Create a project
On the Editor's home screen, choose Linux as the target project. On the launcher you can set:
- Display resolution — the logical resolution passed to LVGL (default 800 × 480).
- Display backends — which backends to compile in. At runtime they are tried in order until one initializes: SDL → Wayland → X11 → DRM → fbdev. It's safe to leave several enabled; the right one is picked automatically.
- Optional features — e.g. 3D support (OpenGL ES + NanoVG). These can also be changed later in
lv_conf.defaults.
Get started
The generated project is a standard CMake application. Its README.md has the full details; the steps below are the general flow.
1. Install the requirements
You always need CMake ≥ 3.18, Python 3 (+ python3-venv), and a C/C++ compiler. Ninja is optional but speeds up builds. Beyond that, install the development libraries for the backends and features you enabled:
# Debian / Ubuntu
sudo apt install \
build-essential cmake ninja-build python3 python3-venv \
libsdl2-dev \
libwayland-dev libxkbcommon-dev \
libx11-dev \
libdrm-dev \
libevdev-dev \
libgles2-mesa-dev# Arch
sudo pacman -S \
base-devel cmake ninja python python-virtualenv \
sdl2 wayland libxkbcommon libx11 libdrm libevdev mesa# Fedora
sudo dnf install \
@development-tools cmake ninja-build python3 python3-virtualenv \
SDL2-devel wayland-devel libxkbcommon-devel libX11-devel \
libdrm-devel libevdev-devel mesa-libGLES-develOn first configure, CMake fetches LVGL and other optional libraries (FreeType, libpng, libjpeg-turbo, …) automatically. Only kernel-coupled libraries such as libdrm must be present on the system (or in your sysroot when cross-compiling) — they are not fetched.
2. Build and run
cmake -B build -GNinja
cmake --build build
./build/lvgl_linuxRun the binary from the project root so the A:ui asset path resolves to the ui/ folder. You can override the resolution (and other options) at configure time:
cmake -B build -DLV_HOR_RES=1280 -DLV_VER_RES=800Configuration
LVGL is configured through lv_conf.defaults in the project root. CMake merges it with LVGL's lv_conf_template.h at configure time to produce build/lv_conf.h. Only options that differ from the defaults need to be listed. Common backend switches:
| Option | Description |
|---|---|
LV_USE_SDL | SDL2 backend |
LV_USE_WAYLAND | Wayland backend |
LV_USE_X11 | X11 backend |
LV_USE_LINUX_DRM | DRM/KMS backend (embedded) |
LV_USE_LINUX_FBDEV | Framebuffer backend (embedded) |
LV_USE_EVDEV | evdev input (needed for DRM and fbdev) |
A few useful CMake cache variables (pass with -D):
| Variable | Default | Description |
|---|---|---|
LV_HOR_RES / LV_VER_RES | 800 / 480 | Display resolution |
UI_DIR | ui | Path to the exported Editor UI |
UI_PROJECT_NAME | (auto) | Override the UI init function name |
UI_DEFAULT_SCREEN | (auto) | Override the default screen to load |
Cross-compiling for a board
For an embedded target, build with a CMake toolchain file that sets the cross compiler, sysroot, and architecture:
cmake -B build-arm -GNinja \
-DCMAKE_TOOLCHAIN_FILE=toolchain-armv7.cmake \
-DLV_HOR_RES=480 -DLV_VER_RES=272
cmake --build build-armLibraries fetched by CMake (LVGL, FreeType, …) are compiled for the target automatically; system libraries such as libdrm must be present in the sysroot. For Yocto and Buildroot, use the toolchain file generated by the SDK (environment-setup-* for Yocto, .../toolchainfile.cmake for Buildroot). See the project's README.md for a complete toolchain-file example.
Updating the UI
Design your UI in the Editor and export to the project's ui/ folder. The build system detects it automatically and links it into the application, so re-exporting is all it takes to update the interface.
Last updated on