Building from source

Lexicon is a single CMake target with two Qt module dependencies. If you have Qt 6 and a C++23 compiler, you're three commands away from a running binary.

Prerequisites

ToolMinimumNotes
CMake3.21Required by cmake_minimum_required
CompilerC++23 supportGCC 13+, Clang 16+, or MSVC 19.3x recommended
QtQt 6 (Qt 5 fallback)Modules: Widgets, Sql. The build prefers Qt 6 and falls back to Qt 5 if Qt 6 is absent.
SQLite driver—The Qt SQLite plugin (QSQLITE) must be available at runtime

Debian/Ubuntu one-liner:

sudo apt update
sudo apt install -y build-essential cmake qt6-base-dev libqt6sql6-sqlite

Standard build

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

The build compiles the application sources and the vendored md4qt Markdown parser (about 35 translation units from 3rdparty/md4qt/src) into one executable. AUTOMOC and AUTORCC are enabled, so Qt meta-object code is generated automatically.

â„šī¸

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.

Build configurations

ConfigurationCommandUse for
Release-DCMAKE_BUILD_TYPE=ReleaseDay-to-day use
Debug-DCMAKE_BUILD_TYPE=DebugDevelopment, debugging with gdb/lldb
RelWithDebInfo-DCMAKE_BUILD_TYPE=RelWithDebInfoProfiling 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

Windows

macOS

IDE setup