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
| Tool | Minimum | Notes |
|---|---|---|
| CMake | 3.21 | Required by cmake_minimum_required |
| Compiler | C++23 support | GCC 13+, Clang 16+, or MSVC 19.3x recommended |
| Qt | Qt 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
| 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 fine; no vendor SDK needed.
- The
lexicon.desktopfile in the repository can be installed for menu integration.
Windows
- The 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. (The repository contains an.idea/folder from CLion development.) - VS Code â use the CMake Tools extension; select a kit with your C++23 compiler and add the Qt path to
cmake.configureSettings.