Switch to cmake + vcpkg, builds on linux, windows needs verification.

Code has been modified to be portable.
This commit is contained in:
eelke 2026-10-17 16:21:22 +02:00
parent c1a5ac1aad
commit 49f6619a4e
34 changed files with 678 additions and 327 deletions

View file

@ -11,3 +11,41 @@ The release notes use collected from git using [reno](https://docs.openstack.org
- googletest
- libpq
Boost, Botan, libpq and googletest are provided by vcpkg through the manifest in `vcpkg.json`, so you do not install them manually.
## Required tools
- CMake 3.21 or newer
- A C++20 compiler (GCC or Clang on Linux, Visual Studio 2022 on Windows)
- Qt 6 with the Core, Gui, Widgets, Sql and Concurrent components
- vcpkg, with the `VCPKG_ROOT` environment variable pointing to its checkout
- Ninja or make (optional, for faster builds)
- A PostgreSQL server (only needed to run the application against a database)
## Building
Configure with the vcpkg toolchain file. The first configure downloads and builds the dependencies, which takes a while:
```
cmake -S . -B build -DCMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake
cmake --build build
```
To skip the test executables, add `-DBUILD_TESTS=OFF` to the configure command.
## Running the tests
From the build directory, run:
```
ctest --output-on-failure
```
## Running the application
The executable is built to `build/pglab/pglab`. On a machine without a display, set `QT_QPA_PLATFORM=offscreen`:
```
./build/pglab/pglab
```