Build Systemο
Common Requirementsο
Before building, make sure you have the following tools installed:
A C++17 compatible compiler
Compiler installation by operating systemο
Windowsο
On Windows, we recommend using Microsoft Visual Studio 17 2022 as the CMake generator and compiler.
Download and install Visual Studio 2022 (Community, Professional, or Enterprise edition) from: https://visualstudio.microsoft.com/vs/
- During installation, make sure to select the following components:
Desktop development with C++
Linuxο
On Linux, you can use g++ as your C++17-compatible compiler.
Install all requirements using your package manager. For example:
# Ubuntu
sudo apt update
sudo apt install -y g++ cmake make curl pkg-config libx11-dev libxft-dev libxcursor-dev
Release Requirementsο
Windowsο
For Windows release packaging, the Nullsoft Scriptable Install System (NSIS) is required.
NSIS β used to generate the project installer (.exe) during the release build.
Installation guide: https://nsis.sourceforge.io/Download
Linuxο
For Linux release packaging, there are no mandatory external requirements for the CPack packaging tool to generate the launch package in TGZ (tar.gz) format.
Documentation Requirementsο
To build the project documentation, the following tools are required:
- Doxygen 1.9.8+
Used to generate the C++ API reference documentation.
Windows
Download the Windows installer from: https://www.doxygen.nl/download.html
- During installation, make sure to check:
Add doxygen to the system PATH.
- Linux
On Ubuntu-based systems:
sudo apt update sudo apt install doxygen
- Doxygen extensions
In order to include class diagrams and dependency graphs, Graphviz must also be installed.
Windows
Download the installer from: https://graphviz.org/download/
Ensure you select the option to add Graphviz to your
PATHduring installation.
Linux
On Ubuntu-based systems:
sudo apt update sudo apt install graphviz
Python 3.10+ Required to run Sphinx and its extensions.
Installation guide: https://www.python.org/downloads/
- Sphinx 8.1.3+
Used to generate the general documentation in HTML and other formats.
Install using Pythonβs package manager:
python -m pip install sphinx==8.1.3
Sphinx extensions
Several Sphinx extensions are required for styling, localization, and integration with Doxygen:
sphinx-rtd-themeβ provides the Read the Docs visual theme.sphinx-intlβ used to manage translations of the documentation.
To install all required dependencies:
python -m pip install sphinx-rtd-theme sphinx-intl
Developer Setupο
To get started with the project, make sure Git is installed on your system.
Install Git: You can download and install it from the official website: https://git-scm.com/downloads
Once Git is available, clone the repository from GitHub:
# Clone the repository and submodules git clone --recurse-submodules https://github.com/jordiSpider/Weaver.git
CMake Presetsο
This project uses CMakePresets.json to manage all build configurations, documentation builds, and deployment workflows.
Presets provide predefined configurations for consistent builds across different systems and environments. All presets can be listed using:
cmake --list-presets
or executed as workflows with:
cmake --workflow --preset <preset-name>
Available Presetsο
The presets are organized into three categories:
1. Executable builds
These presets compile the main application, either with or without a graphical interface.
Preset |
Description |
|---|---|
|
Builds the Windows GUI version in Debug mode. |
|
Builds the Windows GUI version in Release mode. |
|
Builds the Windows non-GUI version in Debug mode. |
|
Builds the Windows non-GUI version in Release mode. |
|
Builds the Linux GUI version in Debug mode. |
|
Builds the Linux GUI version in Release mode. |
|
Builds the Linux non-GUI version in Debug mode. |
|
Builds the Linux non-GUI version in Release mode. |
Example usage:
cmake --workflow --preset windows-non-gui-release
- This command will:
Configure CMake with all preset options.
Build the project using the specified compiler and triplet.
2. Documentation builds
The project includes dedicated presets for generating and deploying documentation built with Sphinx and Doxygen.
Preset |
Description |
|---|---|
|
Builds documentation locally for development preview. |
|
Builds and deploys documentation to GitHub Pages. |
|
Updates the existing deployed documentation. |
|
Generates translation files for documentation. |
Example usage:
cmake --workflow --preset deploy-docs
3. Common internal presets
The following presets define shared variables and configurations used by other presets. They are marked as hidden and should not be invoked directly:
commonβ Defines global paths and metadata.executablesβ Base for all executable builds.gui/non-guiβ Enable or disable GUI mode.debug/releaseβ Define build type (Debug or Release).docsβ Base for documentation-related builds.
Updating vcpkg Versionο
The project includes vcpkg as a Git submodule under external/vcpkg.
Occasionally, it may be necessary to update the version of vcpkg used by the project
(e.g., to obtain newer libraries or fixes).
When updating the vcpkg submodule, the following steps must be performed:
Update the submodule
cd external/vcpkg git pull origin master
Obtain the new commit hash
The current vcpkg commit is used as a baseline reference in the projectβs
vcpkg.jsonfile (fieldbuiltin-baseline). After updating the submodule, retrieve the new commit hash with:rev-parse HEADUpdate the `builtin-baseline` field
Copy the hash obtained in the previous step and update the value of
builtin-baselinein yourvcpkg.jsonfile accordingly:{ "builtin-baseline": "new_commit_hash_here", "dependencies": [ ] }
Commit the changes
Once the submodule and baseline have been updated, commit the modifications:
git add external/vcpkg vcpkg.json git commit -m "Update vcpkg submodule and builtin-baseline"