Skip to content
ispyisail edited this page Sep 11, 2026 · 2 revisions

Construire QElectroTech

Instructions pour construire QElectroTech à partir du code source.

Prérequis

Avant de construire, assurez-vous d'avoir les bons outils et bibliothèques installés.

Qt6 est la version par défaut. Depuis a1c090781 (septembre 2026), CMakeLists.txt définit QT_VERSION_MAJOR à 6 lorsque rien n'est spécifié, et la branche Qt5 a été abandonnée. Qt 5.15 a atteint sa fin de vie en 2025. Ne construisez avec Qt5 que si vous avez une raison précise, en passant -DQT_VERSION_MAJOR=5.

Linux

Ubuntu/Debian :

sudo apt update
sudo apt install build-essential cmake ninja-build git pkg-config

# Qt6
sudo apt install qt6-base-dev qt6-base-private-dev libqt6svg6-dev \
                 libqt6sql6-sqlite qt6-tools-dev qt6-tools-dev-tools \
                 qt6-l10n-tools libqt6pdf6 qt6-pdf-dev

# SQLite, et CUPS — voir la note ci-dessous
sudo apt install libsqlite3-dev libcups2-dev

Sur Ubuntu 22.04, libgl1-mesa-dev et libegl1-mesa-dev peuvent également être nécessaires.

Fedora/RHEL :

sudo dnf groupinstall "Development Tools"
sudo dnf install cmake ninja-build git qt6-qtbase-devel qt6-qtsvg-devel \
                 qt6-qttools-devel sqlite-devel cups-devel

Arch Linux :

sudo pacman -S base-devel cmake ninja git qt6-base qt6-svg qt6-tools \
               sqlite libcups

Pourquoi CUPS est nécessaire

QElectroTech n'utilise pas CUPS lui-même. Par défaut, la construction compile également deux bibliothèques KDE Frameworks (KF6CoreAddons, KF6WidgetsAddons) à partir des sources, et celles-ci nécessitent CUPS pour la prise en charge des boîtes de dialogue d'impression. Sans les en-têtes de développement, la configuration échoue avant même la moindre compilation :

-- Could NOT find Cups (missing: CUPS_LIBRARIES CUPS_INCLUDE_DIR)
CMake Error at .../FeatureSummary.cmake:869 (message):
  feature_summary() Error: REQUIRED package(s) are missing, aborting CMake

Deux solutions : installer le paquet de développement CUPS comme ci-dessus, ou installer les paquets KDE Frameworks fournis par votre distribution et configurer avec -DBUILD_KF=NO afin que la construction les utilise au lieu de compiler les siens.

macOS

  1. Installer Xcode Command Line Tools :

    xcode-select --install
  2. Installer dépendances via Homebrew :

    brew install cmake ninja git qt
    # ou pour Qt6 :
    brew install cmake git qt
  3. Définir chemin Qt (si nécessaire) :

    export Qt6_DIR=$(brew --prefix qt)/lib/cmake/Qt6
    # ou pour Qt6 :
    export Qt_DIR=$(brew --prefix qt)/lib/cmake/Qt6

Windows

Option 1 : Visual Studio (Recommandé)

  1. Installer Visual Studio Community (gratuit)
    • Sélectionner "Desktop development with C++"
    • Inclut compilateur MSVC
  2. Installer CMake depuis cmake.org
  3. Installer Qt5 ou Qt6 depuis qt.io
    • Choisir "MSVC 2019 64-bit" (ou 2022)

Option 2 : MinGW (Alternative)

  1. Installer MinGW avec support C++
  2. Installer CMake
  3. Installer Qt5 (build MinGW)

Option 3 : WSL (Windows Subsystem for Linux)

  1. Activer WSL2
  2. Installer Ubuntu dans WSL
  3. Suivre instructions Linux ci-dessus

Git et Code Source

Cloner le référentiel avec sous-modules :

git clone --recursive https://github.com/qelectrotech/qelectrotech-source-mirror.git
cd qelectrotech-source-mirror

Le drapeau --recursive est important pour obtenir toutes les dépendances.


Construire à Partir de la Source

Étape 1 : Cloner le Référentiel

git clone https://github.com/qelectrotech/qelectrotech-source-mirror.git
cd qelectrotech-source-mirror

Étape 2 : Configurer la Construction

mkdir build && cd build
cmake ..

Étape 3 : Compiler

cmake --build . --config Release

Ou utiliser l'outil de construction de votre plateforme :

Linux/macOS :

make -j$(nproc)

Windows (MSVC) :

cmake --build . --config Release --parallel

Étape 4 : Installer (Optionnel)

cmake --install .

Ou exécuter le binaire depuis le répertoire de construction.


Variantes de Construction

Construction de Débogage

cmake -DCMAKE_BUILD_TYPE=Debug ..
cmake --build .

Avec AddressSanitizer (ASAN)

cmake -DCMAKE_CXX_FLAGS="-fsanitize=address" ..
cmake --build .

Avec ThreadSanitizer (TSan)

cmake -DCMAKE_CXX_FLAGS="-fsanitize=thread" ..
cmake --build .

Tests

Exécuter les Tests

cd build
ctest

Ou exécuter avec verbosité :

ctest --verbose

Dépannage

Problème : Could NOT find Cups

-- Could NOT find Cups (missing: CUPS_LIBRARIES CUPS_INCLUDE_DIR)
CMake Error at .../FeatureSummary.cmake:869 (message):
  feature_summary() Error: REQUIRED package(s) are missing, aborting CMake

Solution : la construction compile par défaut deux bibliothèques KDE Frameworks à partir des sources, et elles nécessitent CUPS. Installez le paquet de développement (libcups2-dev, cups-devel ou libcups selon la distribution), ou configurez avec -DBUILD_KF=NO pour utiliser les paquets KDE Frameworks de votre distribution.

Problème : The following REQUIRED packages have not been found: Qt6

Il s'agit généralement d'un cache de dépendances obsolète plutôt que d'un paquet manquant — cela survient le plus souvent après le passage à Qt6 par défaut, sur une arborescence précédemment configurée pour Qt5.

Solution : les dépendances téléchargées sont mises en cache en dehors du répertoire de construction, dans ~/.cache/qet-deps. Supprimer uniquement le répertoire de construction ne vide pas ce cache : les Extra CMake Modules en cache restent configurés pour l'ancienne version de Qt et échouent en réclamant la nouvelle.

rm -rf ~/.cache/qet-deps build/
cmake -S . -B build -G Ninja

Problème : CMake ne trouve pas Qt

Solution :

cmake -S . -B build -DCMAKE_PREFIX_PATH=/chemin/vers/Qt/6.x.x/gcc_64

Sur macOS avec Homebrew : export Qt6_DIR=$(brew --prefix qt)/lib/cmake/Qt6.

Problème : mélange de versions de Qt

INTERFACE_QT_MAJOR_VERSION of "Qt5::Core" does not agree with QT_MAJOR_VERSION signifie qu'une partie de la construction a trouvé Qt5 et une autre Qt6.

Solution : configurez depuis un répertoire de construction vierge et passez -DQT_VERSION_MAJOR pour que le choix soit explicite.

Problème : "Permission denied" sur Linux

Solution :

sudo chown -R $USER:$USER .

Problème : Construisez très lent

Solutions :

  • Utiliser Ninja à la place de Make : cmake -GNinja ..
  • Augmenter parallélisation : cmake --build . -j8
  • Utiliser ccache : cmake -DCMAKE_CXX_COMPILER_LAUNCHER=ccache ..

Prochaines Étapes

Après avoir construit QET :

  1. Tester l'application : ./qelectrotech (ou exécutable Windows/macOS)
  2. Exécuter les tests : ctest
  3. Lire le code : Explorez le répertoire sources/
  4. Contribuer : Voir Contribuer à QET

Ressources Supplémentaires


🌐 Choisir la Langue — English · Français · Deutsch

Getting Started

Home

🌐 Languages — English · Français · Deutsch

Downloads

Windows without admin rights — the portable archive, no installer

Quick Start Guide

User Manual

FAQ

Tips & Tricks

Guides

Conductors — wire properties, what feeds which export, cables, and hops where wires cross

Wires per terminal — limit the wires on a terminal, chain wiring instead of stars

Printing and exporting — paper, PDF, images, and what each path does differently

Linking elements — master, slave, terminal

PLC modules — I/O tables and linking a wire to a specific point

Using the element editor — drawing tools, saving, checks

Generic devices — a quick box symbol with terminals on any side, made by a wizard (pending)

Grid size and element size — why symbols aren't all the same scale, and scaling one without leaving the grid

Preferences reference — what each settings page does

Saving and loading settings — your whole setup in one file, to copy or keep

Keyboard-only control — mouseless QET, and what still needs a mouse

Mouse modifiers — what Shift, Ctrl and Alt change while you drag

3D mouse — SpaceMouse pan, zoom and buttons

Aligning items — snap symbols back to the grid, or line them up

Pictures on a sheet — labels, crop, transparency, what they cost in the file

Arcs and curved wires — the Arc tool, pulling an arc in or out, rounding a corner with a fillet, dashed arcs for lighting layouts

Grouping items — select, move and copy several items as one

Finding your place on a sheet — go to a cell like B13 or 4-B7, keep the headers in sight, show the cell limits, zoom and pan

Showing and hiding kinds of items — hide texts, wire numbers, shapes, pictures, tables or cross-references on every sheet

Drawing faster — place without dragging, the S shortcut bar, command search, gestures

Customising QElectroTech — keys, toolbar size and contents, the gesture ring (partly pending)

Managing collections — folders, writability, building your own shortlist

Templates — reusable multi-element blocks, placed by double-click or drag

Search & Replace — bulk property changes

Building a nomenclature query — the BOM/summary table builder

Linking wires across pages — sheet reports

Variables & formulas — %f, %{label}, sequences

Auto-numbering — schemes, sequences, freezing

Terminal strips — strips, levels, bridges

Title block templates — the .titleblock format

Importing EPLAN parts (.edz) — EPLAN Data Portal

DXF import & export — two unrelated features, one format; command-line export and layers

The project database — the in-memory SQLite cache

File formats
Elements XML
Project XML
Development

Building from Source

Contributing Code

Automating QET — CLI, XML formats, external tools

CLI Reference — command line usage

JavaScript Scripting — --run, geometry editing, undo

MCP server — let an AI assistant read, verify and edit projects

Connecting an AI assistant — setup for Claude, Copilot, Gemini, Codex, Cursor, LM Studio

Script buttons — stored scripts with an icon, by hand or by an assistant

Live mode — an assistant working in the open project while you watch

Macro recorder — record a task by hand, for an assistant to script

Development Roadmap

Vision — proposal, under discussion

Developer Tools

About

Features

History

Community

License

Contributing to this Wiki

Clone this wiki locally