diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index 4cc90c82a..3b5f37d67 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -49,6 +49,7 @@ jobs: mingw-w64-ucrt-x86_64-qt6-tools mingw-w64-ucrt-x86_64-qt6-translations mingw-w64-ucrt-x86_64-qt6-pdf + mingw-w64-ucrt-x86_64-sqlite3 mingw-w64-ucrt-x86_64-pkg-config mingw-w64-ucrt-x86_64-kwidgetsaddons mingw-w64-ucrt-x86_64-kcoreaddons @@ -121,7 +122,8 @@ jobs: -DQET_EXPORT_PROJECT_DB=ON \ -DCMAKE_C_COMPILER_LAUNCHER=/ucrt64/bin/ccache \ -DCMAKE_CXX_COMPILER_LAUNCHER=/ucrt64/bin/ccache \ - + -DSQLite3_INCLUDE_DIR=/ucrt64/include \ + -DSQLite3_LIBRARY=/ucrt64/lib/libsqlite3.dll.a \ .. ninja -j"$NPROC" @@ -194,6 +196,13 @@ jobs: cp /ucrt64/bin/libgcc_s_seh-1.dll "$BIN/" cp /ucrt64/bin/libstdc++-6.dll "$BIN/" cp /ucrt64/bin/libwinpthread-1.dll "$BIN/" + SQLITE=$(find /ucrt64/bin -name "libsqlite3*.dll" | head -1) + if [ -n "$SQLITE" ]; then + cp "$SQLITE" "$BIN/" + echo "SQLite3 copied: $(basename $SQLITE)" + else + echo "WARNING: libsqlite3 not found in /ucrt64/bin/" + fi cp "$GITHUB_WORKSPACE/build-aux/windows/QET64.nsi" "$NSIS_ROOT/" cp "$GITHUB_WORKSPACE/build-aux/windows/lang_extra.nsh" "$NSIS_ROOT/" diff --git a/INSTALL.md b/INSTALL.md index ef4eaef78..eeb14e741 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -27,12 +27,18 @@ git submodule update --init --recursive | C++17 compiler | required | GCC or Clang on Unix-like platforms; MSVC or MinGW-w64 g++ on Windows — see [Choosing a compiler](#3-choosing-a-compiler-unix) / [Building on Windows](#6-building-on-windows-msvc--mingw) | | Qt6 base + widgets | required | | | Qt6 **GuiPrivate** headers | required | needed for clickable PDF hyperlinks; **hard build failure** at CMake generate time if missing, see below | +| SQLite3 | required | used by the nomenclature/summary database | | Qt Linguist tools (`lrelease`) | required | compiles the tracked `.ts` files into `.qm` as part of every normal build | | pugixml | handled automatically | fetched and built via CMake FetchContent if not already present on the system — see [pugixml](#8-pugixml) below | | Qt Test module | required if building tests | `PACKAGE_TESTS` is `ON` by default; QtTest ships as part of the base Qt6 dev packages listed below on every platform, no extra package needed | | KDE Frameworks (KF6) | optional | see [Building without KDE Frameworks](#9-building-without-kde-frameworks) | | QtPdf module | optional | see [PDF page import](#7-pdf-page-import-qtpdf) | +A note on CMake versions: the project declares a minimum of 3.5 but is +routinely built with much newer releases; if your CMake is older than 4.3 it +simply won't have the newer `SQLite3::SQLite3` target name, which the build +script compensates for automatically. There is nothing you need to do either +way. ## 3. Building (out-of-source build) @@ -100,7 +106,7 @@ the closest match. sudo apt install \ build-essential cmake ninja-build git \ qt6-base-dev qt6-base-private-dev qt6-tools-dev qt6-tools-dev-tools \ - + libsqlite3-dev \ libkf6coreaddons-dev libkf6widgetsaddons-dev ``` @@ -132,6 +138,7 @@ sudo apt install libpugixml-dev sudo dnf install \ cmake gcc-c++ git \ qt6-qtbase-devel qt6-qtbase-private-devel qt6-qttools-devel \ + sqlite-devel \ kf6-kcoreaddons-devel kf6-kwidgetsaddons-devel ``` @@ -148,10 +155,11 @@ Optional, for a system pugixml: `sudo dnf install pugixml-devel`. pkg install \ cmake git \ qt6-base qt6-tools \ + sqlite3 \ kf6-kcoreaddons kf6-kwidgetsaddons ``` -(from ports: `devel/qt6-base`, `devel/qt6-tools`, +(from ports: `devel/qt6-base`, `devel/qt6-tools`, `databases/sqlite3`, `devel/kf6-kcoreaddons`, `x11-toolkits/kf6-kwidgetsaddons`.) Qt6's `GuiPrivate` headers ship as part of `qt6-base` on FreeBSD, no separate package is needed. `QtPdf` is not packaged on FreeBSD at the time of writing @@ -167,7 +175,7 @@ Optional, for a system pugixml: `pkg install pugixml` (`devel/pugixml`). Using [Homebrew](https://brew.sh): ```sh -brew install cmake qt ninja +brew install cmake qt sqlite ninja ``` Homebrew's `qt` formula is Qt6 and includes the private headers, so no @@ -185,7 +193,7 @@ Optional, for a system pugixml: `brew install pugixml`. See [Building on Windows](#6-building-on-windows-msvc--mingw) below — the package sources differ enough from the Unix-like platforms above (no system -package manager and Qt aren't provided the same way) that it gets +package manager, SQLite3 and Qt aren't provided the same way) that it gets its own section. ## 5. pugixml @@ -207,7 +215,7 @@ on Debian/Ubuntu, `pugixml-devel` on Fedora). Both toolchains QET's CMake build targets on Windows are covered here: **MSVC** (Visual Studio 2019/2022) and **MinGW-w64** (gcc). Unlike the Unix-like platforms above, there's no single system package manager, so -Qt and (optionally) KDE Frameworks each need to be sourced +Qt, SQLite3 and (optionally) KDE Frameworks each need to be sourced separately per toolchain. One piece of good news either way: unlike Debian/Fedora, the official Qt @@ -228,7 +236,11 @@ normally use `-DBUILD_WITH_KF=OFF` (see the 1. Install Visual Studio with the "Desktop development with C++" workload, and install Qt6 for MSVC (e.g. the `msvc2019_64` or `msvc2022_64` kit) via the [Qt Online Installer](https://www.qt.io/download-qt-installer). -2. Configure and build from an "x64 Native Tools Command Prompt for VS": +2. Get SQLite3 — the simplest route is [vcpkg](https://vcpkg.io): + ```bat + vcpkg install sqlite3:x64-windows + ``` +3. Configure and build from an "x64 Native Tools Command Prompt for VS": ```bat mkdir build && cd build cmake .. -G "Visual Studio 17 2022" -A x64 ^ @@ -281,7 +293,9 @@ Using the Qt Online Installer's bundled MinGW kit instead: point `CMAKE_PREFIX_PATH` at that kit (e.g. `C:\Qt\6.x.x\mingw_64`) and make sure its bundled `g++.exe` comes first on `PATH`, or pass `-DCMAKE_C_COMPILER`/`-DCMAKE_CXX_COMPILER` explicitly so CMake doesn't pick -up a different MinGW installation. +up a different MinGW installation. SQLite3 still has to come from elsewhere +in this path — vcpkg with a `mingw`-flavoured triplet, or MSYS2's package as +above. ## 7. Qt6 private headers (mandatory) diff --git a/build-aux/snap/snapcraft.yaml b/build-aux/snap/snapcraft.yaml index 07a5e8955..9f27a510c 100644 --- a/build-aux/snap/snapcraft.yaml +++ b/build-aux/snap/snapcraft.yaml @@ -71,6 +71,7 @@ parts: source: . stage-packages: - git + - sqlite3 - xdg-user-dirs - libqt6qml6 # libxcb-cursor0 workaround was needed against the Qt5/KF5 core22 content @@ -81,7 +82,7 @@ parts: - git - cmake - ninja-build - + - libsqlite3-dev - qt6-tools-dev - qt6-base-private-dev - qt6-declarative-dev diff --git a/packaging_script_AppImage_aarch64.sh b/packaging_script_AppImage_aarch64.sh index 1e6498c4c..fb4a0e032 100644 --- a/packaging_script_AppImage_aarch64.sh +++ b/packaging_script_AppImage_aarch64.sh @@ -1,7 +1,7 @@ #!/bin/bash #Based on raspberry pi 5 8 Gb Trixie -#sudo apt install git ssh rsync libqt5svg5-dev qt5-qmake qtbase5-dev libkf5widgetsaddons-dev libkf5coreaddons-dev pkgconf libqt5waylandclient5-dev libqt5waylandcompositor5-dev g++ make +#sudo apt install git ssh rsync libqt5svg5-dev qt5-qmake qtbase5-dev libkf5widgetsaddons-dev libkf5coreaddons-dev libsqlite3-dev pkgconf libqt5waylandclient5-dev libqt5waylandcompositor5-dev g++ make #mkdir -p AppImage/0.100.0/aarch64 # Get GIT sources #git clone --recursive https://github.com/qelectrotech/qelectrotech-source-mirror.git