This is part of a series of posts on compiling a custom version of Qt5 in order to develop for both amd64 and a Raspberry Pi.
These are instructions for building Qt Creator with the custom Qt, so that it can load and use Designer plugins built with it.
Sadly, because of the requirement of being able to load Designer plugins, and because of the requirement of being able to compile custom widgets using the custom Qt and use them in the Designer, we need to also rebuild Qt Creator.
The resulting packaging is at https://github.com/Truelite/qt5custom.
Set up sources
Open the source tarball, and add the Qt Creator packaging:
tar axf qt-creator-enterprise-src-4.12.2.tar.xz
cp -a debian-qtcreator qt-creator-enterprise-src-4.12.2/debian
ln -s qt-creator-enterprise-src-4.12.2.tar.xz qt-creator-enterprise-src_4.12.2.orig.tar.xz
If needed, install the Qt license:
cp qt-license.txt ~/.qt-license
Install build dependencies
You can use apt build-dep
to install dependencies manually:
cd qt-creator-enterprise-src-4.12.2
apt build-dep .
Alternatively, you can create an installable .deb
metapackage that depends on
the build dependencies:
apt install devscripts
mk-build-deps debian-qtcreator/control
apt -f install qt-creator-enterprise-src-build-deps_4.12.2-1_all.deb
Package build
The package is built by debian/rules
base on the excellent work done by
Debian Qt5 maintainers.
After installing the build dependencies, you can build like this:
cd qt-creator-enterprise-src-4.12.2
debuild -us -uc -rfakeroot
In debian/rules
you can configure NUMJOBS
with the number of available
CPUs in the machine, to have parallel builds.
debian/rules
automatically picks qt5custom
as the Qt version to use for
the build.
NOTE: Qt Creator 4.12.2 will NOT build if qtbase5custom-armhf-dev
is
installed. One needs to make sure to have qtbase5custom-dev
installed, but
NOT qtbase5custom-armhf-dev
. Despite quite a bit of investigation, I have
been unable to understand why, if both are installed, Qt Creator's build
chooses the wrong one, and fails the build.
Build output
Building sources generates 4 packages:
qtcreator-qt5custom
: the programqtcreator-qt5custom-data
: program dataqtcreator-qt5custom-doc
: documentationqtcreator-qt5custom-dbgsym
: debugging symbols
Using the custom Qt Creator Enterprise
The packages are built with qt5custom
and install their content in
/opt/qt5custom
.
The packages are coinstallable with the version of Qt Creator packaged in Debian.
The custom Qt Creator executable is installed in /opt/qt5custom/bin/qtcreator,
which is not in $PATH
by default. To run it, you can explitly use
/opt/qt5custom/bin/qtcreator
. qtcreator
ran without an explicit path, runs
the standard Debian version.
Installing Designer plugins
Designer plugings can be compiled with qt5custom
and installed in
/opt/qt5custom/plugins/designer/
.
Cross-building with Qt Creator
Once the cross-build Qt5 packages are installed, one should see it appear in the Qt Creator kit configuration, where it can be selected and used normally.
If one sets device type to "Generic Linux Device", chooses a compiler for "arm 32bit" and sets Qt Version to "qt5custom-armhf", one can smoothly cross-compile and execute and debug the built program directly on the device.