# Asteria Qt A cross-platform desktop book/document reader built with Qt6/C++. Reimplementation of [asteria-bookreader](../asteria-bookreader) (Electron/React) using a native Qt stack. **Target platforms:** Windows and Linux; macOS planned. ## Prerequisites - **Qt 6.4+** (6.4 minimum for QtPdf; 6.5+ recommended) - **CMake 3.16+** - **C++17 compiler** — GCC 10+ or Clang 12+ on Linux; MSVC 2022 on Windows ## Installing Dependencies ### Linux (Ubuntu/Debian) ```bash sudo scripts/install-deps-ubuntu.sh ``` The script installs the following package groups: | Group | Packages | Required? | |---|---|---| | Qt6 core | `qt6-base-dev`, `qt6-declarative-dev`, `qt6-tools-dev` | Required | | Qt6 extras | `libqt6svg6-dev`, `qt6-shader-baker` | Required | | Qt6 PDF | `libqt6pdf6-dev` | Optional (PDF support) | | Encoding | `libuchardet-dev` | Required (TXT encoding detection) | | Archive | `libquazip-qt6-dev`, `libminizip-dev` | Required (EPUB/ZIP) | | DjVu | `libdjvulibre-dev` | Optional (DjVu support) | | DOC | `libwpd-dev` | Optional (legacy .doc support) | After the script runs it prints a CMake verify step — run it to confirm Qt6 is found: ```bash cmake --find-package -DNAME=Qt6 -DCOMPILER_ID=GNU -DLANGUAGE=CXX -DMODE=EXIST ``` ### Windows **Step 1 — Install Qt 6 manually** via the Qt Online Installer (qt.io/download-open-source): - Select component: `Qt 6.x → MSVC 2022 64-bit` - Also select: `Qt PDF`, `Qt SVG` under the same Qt version **Step 2 — Install toolchain and third-party libs** (run in an elevated PowerShell): ```powershell scripts\install-deps-windows.ps1 ``` Installs: VS Build Tools 2022, CMake, Ninja, Git, vcpkg, and third-party libs (QuaZip, uchardet, DjVuLibre, libwpd) via vcpkg. **Step 3 — Configure CMake** with your Qt install path: ```powershell cmake -B build -DCMAKE_PREFIX_PATH="C:\Qt\6.x.x\msvc2022_64" ` -DCMAKE_TOOLCHAIN_FILE="C:\vcpkg\scripts\buildsystems\vcpkg.cmake" ``` Replace `6.x.x` with your installed Qt version (e.g. `6.7.2`). ## Building ### Command Line ```bash # Debug build (Linux — Qt6 found automatically after running install script) cmake -B build -DCMAKE_BUILD_TYPE=Debug cmake --build build --parallel # Release build cmake -B build-release -DCMAKE_BUILD_TYPE=Release cmake --build build-release --parallel # Run tests ctest --test-dir build --output-on-failure ``` ### Running ```bash ./build/asteria-qt # Linux ./build/asteria-qt.exe # Windows ``` ### CLion 1. Open the project root folder (File → Open) 2. CLion auto-detects `CMakeLists.txt` and configures 3. Select a CMake profile (Debug/Release) in Settings → Build, Execution, Deployment → CMake 4. Build: `Ctrl+F9` / `⌘F9` | Run: `Shift+F10` / `⌃R` 5. On Windows: set `CMAKE_PREFIX_PATH` to your Qt install path in the CMake profile options field ### VSCode 1. Install extensions: **C/C++**, **CMake Tools** 2. Open the project root 3. CMake Tools detects `CMakeLists.txt` automatically; select a kit (GCC on Linux, MSVC on Windows) 4. On Windows, add to `.vscode/settings.json`: ```json { "cmake.configureArgs": [ "-DCMAKE_PREFIX_PATH=C:\\Qt\\6.x.x\\msvc2022_64", "-DCMAKE_TOOLCHAIN_FILE=C:\\vcpkg\\scripts\\buildsystems\\vcpkg.cmake" ] } ``` 5. Build: `Ctrl+Shift+B` | Run: `F5` (with `launch.json`) or CMake Tools' Run button ### Qt Creator 1. File → Open File or Project → select `CMakeLists.txt` 2. Configure the kit (Qt 6 kit must be registered under Edit → Preferences → Kits) 3. Build: `Ctrl+B` / `⌘B` | Run: `Ctrl+R` / `⌘R` 4. On Windows: ensure the Qt 6 MSVC kit is selected