-
Notifications
You must be signed in to change notification settings - Fork 16
Qt build from source
Bernhard Froehler edited this page May 22, 2024
·
5 revisions
On Windows, we exclusively use pre-built Qt binaries.
For our builds on Linux, we currently only use Qt as included in the distribution's package managers. The following guide has not been tested in a while and might be outdated.
- Install build dependencies. On Ubuntu/Debian, execute:
$ sudo apt-get build-dep qt6-default
$ sudo apt-get install libxcb-xinerama0-dev
- Find the latest source release archive from https://download.qt.io/official_releases/qt/ (e.g. https://download.qt.io/official_releases/qt/6.7/6.7.1/single/qt-everywhere-opensource-src-6.7.1.tar.xz for release 6.7.1)
- Download archive to e.g.
/workspace/qt
and open terminal there (we use the version 6.7.1 here, adapt that to the actual version you are using) - Extract:
$ tar xf qt-everywhere-opensource-src-6.7.1.tar.xz
$ mv qt-everywhere-opensource-src-6.7.1 src-6.7.1
- Remove archive:
$ rm qt-everywhere-opensource-src-6.7.1.tar.xz
$ cd src-6.7.1
- Create separate bin directory for out-of-source build:
$ cd .. && mkdir bin-6.7.1 && cd bin-6.7.1
- Configure (make sure to adapt the /dir-to-install-... to the path where you want to install the final build):
$../src-6.7.1/configure -release -opensource -confirm-license -nomake examples -nomake tests -nomake tools -skip qtandroidextras -skip qtconnectivity -skip qtdeclarative -skip qtgamepad -skip qtlocation -skip qtmacextras -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtwebchannel -skip qtwebengine -skip qtwebsockets -skip qtwayland -skip qtvirtualkeyboard -qt-xcb -prefix /dir-to-install-qt-6.7.1
- Build: you'll typically want to utilize multiple cores. To compile using e.g. 8 threads, use
$ make -j 8
- Install:
$ make install
- After you have verified that the build works (by building and running vtk, itk and open_iA using the install directory), and when you're not planning to re-build that same qt version again, you can conserve space by deleting the
src-6.7.1
directory
open_iA Documentation, licensed under CC BY-NC-SA 4.0