Skip to main content

Compile Qt

Most of the Linux distributions are coming with prebuilt Qt library, but HyperBorg is using the latest (currently Qt 6.4) versions, which is not yet made its way into the distros.

The main reason behind using t 6.4 is that after the Qt 5.15.x series, this is the next release from Qt that officially supports WebAssembly.

To lower the complexity of the building system, the same Qt version is used over all platforms.

Resources & prerequisities

The Qt compilation scripts are found in the /scripts in the git repo directory.

To make the compilation easier, these scripts are prefixed with sequence number showing the execution order of each steps.

The compilation requires a lot of CPU power and disk space (around 10GB). If you plan to compile on an RPI, please make sure that the directory is on a normal HDD/SDD otherwise it could put a lot of stress and wear on the SD-card!

Also, for RPI and like, cross compilation is available. There is a separate page for cross-compilation.

Configuration & installation

The configuration could be set in file config.imi in each directory.

For native Qt compilation, we should use the scripts in the QT directory.

You should see the following files there:

- 1_get_prereq - this updates your APT repository and get all the necesseary libraries and files from your OS repository. This should be run once
- 2_get_qt - this DELETES the previous git checkout and clones a fresh new one from code.qt.io (official repo of Qt)
- 3_update_qt - this updates your local git repository from Qt' official repository
- 4_configure_qt - this sets the necesseary parameters for the Qt compilation (including where it should be put and so) By default the Qt would be installed under /usr/local/Qt-<version>
- 5 compile_qt - if configuration was successful, this is the main task that compiles the whole Qt framework. It could take some amount of time (even hours depending on the hardware)
- 6_install_qt - after successful compilation of Qt, it installs all the files of the Qt framework to the destination target (default /usr/locaL/Qt-<version>)
- 7_run_all - this sript runs scripts 2,4,5,6, thus trying to install Qt without stopping after each scripts. Use this if you are familiar with the compilation steps