Building from source
One CMake tree builds the Qt-free backend, the Qt desktop client and LexiconServer. The web client needs no build; the Android app has its own Gradle project.
Prerequisites
| Tool | Minimum | Notes |
|---|---|---|
| CMake | 3.21 | Required by cmake_minimum_required |
| Compiler | C++23 support | GCC 14 is what CI uses; recent Clang or MSVC should work |
| Qt | A recent Qt 6 | Desktop only, modules Core and Widgets. The vendored md4qt needs a newer Qt 6 than Ubuntu 24.04's 6.4; Debian 13's 6.8 works. |
| SQLite | 3.38+ | Native C library with JSON functions; FTS5 enables diacritic-insensitive content search |
| OpenSSL | 3 | Crypto for SHA-256 file identifiers; SSL for the server's TLS |
Debian 13 one-liner:
sudo apt update
sudo apt install -y build-essential cmake ninja-build qt6-base-dev libgl-dev libsqlite3-dev libssl-dev
Desktop client
git clone https://github.com/robertvokac/lexicon.git
cd lexicon
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --target Lexicon -j
./build/Lexicon
Runtime side effect The first run creates lexicon.db in the directory of the executable â for a development build that means inside build/. Delete that file whenever you want a fresh database.
Server, web and Android clients
LexiconServer needs no Qt. Without Qt installed, configure with -DLEXICON_BUILD_DESKTOP=OFF:
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DLEXICON_BUILD_DESKTOP=OFF
cmake --build build --target LexiconServer -j
./build/LexiconServer auth set-user --database ~/lexicon/lexicon.db
./build/LexiconServer --database ~/lexicon/lexicon.db --allowed-origin http://127.0.0.1:8080
# or let the server serve the client too, on its own port:
./build/LexiconServer --database ~/lexicon/lexicon.db --web-dir lexicon-web
Server-side Blob maintenance is local CLI functionality, not REST: use LexiconServer blobs scan --database PATH for a structural check, blobs verify to recalculate every SHA-256, and blobs collect to verify and delete only unused canonical files.
The web client in lexicon-web/ is static files: serve them with any web server, or locally with python3 tools/serve-web.py --port 8080. The Android app builds with ./gradlew assembleDebug in lexicon-android/. docs/server.md, lexicon-web/README.md and lexicon-android/README.md cover deployment, TLS, backups and signing.
Tests
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON
cmake --build build -j
QT_QPA_PLATFORM=offscreen ctest --test-dir build --output-on-failure
node --test lexicon-web/tests/*.test.mjs
python3 tools/web-e2e.py --server build/LexiconServer
cd lexicon-android && LEXICON_SERVER_BINARY=../build/LexiconServer ./gradlew test lint
The C++ suites cover the backend, the REST server over real sockets, backups, old databases, and the desktop dialogs offscreen, including Mass Insert recovery after a partial failure. tools/web-e2e.py drives the web client in headless Chrome against a fresh server and checks a resumable typed Mass Insert worksheet. The Android tests run the Compose screens under Robolectric, some of them against a real LexiconServer. GitHub Actions runs all of it on every push.
Build configurations
| Configuration | Command | Use for |
|---|---|---|
| Release | -DCMAKE_BUILD_TYPE=Release | Day-to-day use |
| Debug | -DCMAKE_BUILD_TYPE=Debug | Development, debugging with gdb/lldb |
| RelWithDebInfo | -DCMAKE_BUILD_TYPE=RelWithDebInfo | Profiling and crash analysis |
If CMake cannot find Qt, point it at your installation:
cmake -S . -B build -DCMAKE_PREFIX_PATH=/path/to/Qt/6.x.y/gcc_64
Platform notes
Linux
- Distribution Qt packages work when they are recent enough (see Prerequisites); no vendor SDK needed.
- The
lexicon.desktopfile in the repository can be installed for menu integration.
Windows
- The desktop target is declared
WIN32_EXECUTABLE, so Release builds start without a console window. - Use the Qt Online Installer and configure with
-DCMAKE_PREFIX_PATH=C:\Qt\6.x.y\msvc2019_64. - With multi-config generators (Visual Studio), pass
--config Releasetocmake --build. - Run
windeployqton the built executable to gather the required Qt DLLs for distribution. - An application icon resource (
resources.rc) is included in the repository.
macOS
- Install Qt via Homebrew (
brew install qt@6) and pass-DCMAKE_PREFIX_PATH="$(brew --prefix qt@6)".
IDE setup
- Qt Creator â open
CMakeLists.txtdirectly; kits handle Qt discovery for you. - CLion â open the project root; set
CMAKE_PREFIX_PATHin Settings â Build â CMake if Qt isn't found. - VS Code â use the CMake Tools extension; select a kit with your C++23 compiler and add the Qt path to
cmake.configureSettings. - Android Studio â open
lexicon-android/as its own project.