# Building QElectroTech from source QElectroTech is built with **CMake** and requires the **current Qt6 only**; Qt5 and the old `qmake`-based build described in earlier versions of this file have been retired. ## 1. Getting the source QET uses git submodules, so clone recursively: ```sh git clone --recursive https://github.com/qelectrotech/qelectrotech-source-mirror.git cd qelectrotech-source-mirror ``` If you already have a non-recursive clone: ```sh git submodule update --init --recursive ``` ## 2. Requirements | Component | Status | Notes | |---|---|---| | CMake ≥ 3.5 | required | CMake 4.3+ is also fine, see note below | | 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) Always build in a separate directory from the source tree — in-source builds are not supported. ```sh mkdir build cd build cmake .. cmake --build . --parallel ``` For a Unix-like platform you'll usually also want an explicit build type, since CMake's default (empty) build type means no optimization and no debug info either: ```sh cmake .. -DCMAKE_BUILD_TYPE=Release ``` To install (default prefix is `/usr/local`; adjust with `-DCMAKE_INSTALL_PREFIX=...` at the configure step if needed): ```sh sudo cmake --install . ``` Useful configure-time options (pass as `-D