Qmake properties
QMake's magical property variants
Everyone who has written QMake project files touched variables, functions and maybe even properties. Properties are a special kind of persistent variable. The full documentation can be found here.
A Qt installation has several built-in properties. Let's list the properties of a native Linux Qt installed in /usr/local/Qt-5.12.3:
$ /usr/local/Qt-5.12.3/bin/qmake -query
QT_SYSROOT:
QT_INSTALL_PREFIX:/usr/local/Qt-5.12.3
QT_INSTALL_ARCHDATA:/usr/local/Qt-5.12.3
QT_INSTALL_DATA:/usr/local/Qt-5.12.3
QT_INSTALL_DOCS:/usr/local/Qt-5.12.3/doc
QT_INSTALL_HEADERS:/usr/local/Qt-5.12.3/include
QT_INSTALL_LIBS:/usr/local/Qt-5.12.3/lib
QT_INSTALL_LIBEXECS:/usr/local/Qt-5.12.3/libexec
QT_INSTALL_BINS:/usr/local/Qt-5.12.3/bin
QT_INSTALL_TESTS:/usr/local/Qt-5.12.3/tests
QT_INSTALL_PLUGINS:/usr/local/Qt-5.12.3/plugins
QT_INSTALL_IMPORTS:/usr/local/Qt-5.12.3/imports
QT_INSTALL_QML:/usr/local/Qt-5.12.3/qml
QT_INSTALL_TRANSLATIONS:/usr/local/Qt-5.12.3/translations
QT_INSTALL_CONFIGURATION:/usr/local/Qt-5.12.3
QT_INSTALL_EXAMPLES:/usr/local/Qt-5.12.3/examples
QT_INSTALL_DEMOS:/usr/local/Qt-5.12.3/examples
QT_HOST_PREFIX:/usr/local/Qt-5.12.3
QT_HOST_DATA:/usr/local/Qt-5.12.3
QT_HOST_BINS:/usr/local/Qt-5.12.3/bin
QT_HOST_LIBS:/usr/local/Qt-5.12.3/lib
QMAKE_SPEC:linux-g++
QMAKE_XSPEC:linux-g++
QMAKE_VERSION:3.1
QT_VERSION:5.12.3
There's an empty sysroot. The installation prefix is /usr/local/Qt-5.12.3.
Binaries, libraries, plugins and all other parts of Qt are installed below that directory. Host data, binaries and libs are also there. The used mkspec is linux-g++. Nothing surprising so far.
Path properties can be setting variables in the file qt.conf in section [Paths].
/get
properties
/get
Let's have a look at how Qt is built. I have the qtbase repository at ~/dev/qt/5.12/qtbase and will run configure there, doing an in-source build:
~/dev/qt/5.12/qtbase $ configure
~/dev/qt/5.12/qtbase $ ./bin/qmake -query
QT_SYSROOT:
QT_INSTALL_PREFIX:/usr/local/Qt-5.12.3
QT_INSTALL_PREFIX/get:/home/someone/dev/qt/5.12/qtbase
QT_INSTALL_ARCHDATA:/usr/local/Qt-5.12.3
QT_INSTALL_ARCHDATA/get:/home/someone/dev/qt/5.12/qtbase
QT_INSTALL_DATA:/usr/local/Qt-5.12.3
QT_INSTALL_DATA/get:/home/someone/dev/qt/5.12/qtbase
QT_INSTALL_DOCS:/usr/local/Qt-5.12.3/doc
QT_INSTALL_DOCS/get:/home/someone/dev/qt/5.12/qtbase/doc
QT_INSTALL_HEADERS:/usr/local/Qt-5.12.3/include
QT_INSTALL_HEADERS/get:/home/someone/dev/qt/5.12/qtbase/include
QT_INSTALL_LIBS:/usr/local/Qt-5.12.3/lib
QT_INSTALL_LIBS/get:/home/someone/dev/qt/5.12/qtbase/lib
QT_INSTALL_LIBEXECS:/usr/local/Qt-5.12.3/libexec
QT_INSTALL_LIBEXECS/get:/home/someone/dev/qt/5.12/qtbase/libexec
QT_INSTALL_BINS:/usr/local/Qt-5.12.3/bin
QT_INSTALL_BINS/get:/home/someone/dev/qt/5.12/qtbase/bin
QT_INSTALL_TESTS:/usr/local/Qt-5.12.3/tests
QT_INSTALL_TESTS/get:/home/someone/dev/qt/5.12/qtbase/tests
QT_INSTALL_PLUGINS:/usr/local/Qt-5.12.3/plugins
QT_INSTALL_PLUGINS/get:/home/someone/dev/qt/5.12/qtbase/plugins
QT_INSTALL_IMPORTS:/usr/local/Qt-5.12.3/imports
QT_INSTALL_IMPORTS/get:/home/someone/dev/qt/5.12/qtbase/imports
QT_INSTALL_QML:/usr/local/Qt-5.12.3/qml
QT_INSTALL_QML/get:/home/someone/dev/qt/5.12/qtbase/qml
QT_INSTALL_TRANSLATIONS:/usr/local/Qt-5.12.3/translations
QT_INSTALL_TRANSLATIONS/get:/home/someone/dev/qt/5.12/qtbase/translations
QT_INSTALL_CONFIGURATION:/usr/local/Qt-5.12.3
QT_INSTALL_CONFIGURATION/get:/home/someone/dev/qt/5.12/qtbase
QT_INSTALL_EXAMPLES:/usr/local/Qt-5.12.3/examples
QT_INSTALL_EXAMPLES/get:/home/someone/dev/qt/5.12/qtbase/examples
QT_INSTALL_DEMOS:/usr/local/Qt-5.12.3/examples
QT_INSTALL_DEMOS/get:/home/someone/dev/qt/5.12/qtbase/examples
QT_HOST_PREFIX:/usr/local/Qt-5.12.3
QT_HOST_PREFIX/get:/home/someone/dev/qt/5.12/qtbase
QT_HOST_DATA:/usr/local/Qt-5.12.3
QT_HOST_DATA/get:/home/someone/dev/qt/5.12/qtbase
QT_HOST_BINS:/usr/local/Qt-5.12.3/bin
QT_HOST_BINS/get:/home/someone/dev/qt/5.12/qtbase/bin
QT_HOST_LIBS:/usr/local/Qt-5.12.3/lib
QT_HOST_LIBS/get:/home/someone/dev/qt/5.12/qtbase/lib
QMAKE_SPEC:linux-g++
QMAKE_XSPEC:linux-g++
QMAKE_VERSION:3.1
QT_VERSION:5.12.3
Now we see that some properties got counterparts ending with `/get`.
Apparently all those contain paths.
Let's put our focus on
QT_INSTALL_LIBS
, which is where Qt's libraries are placed. While qtbase is begin built, we haven't anything in
$$[QT_INSTALL_LIBS]
yet. How can QtGui then link against QtCore? It must use some other location: the build location of QtCore. This is what
$$[QT_INSTALL_LIBS/get]
gives us: /home/someone/dev/qt/5.12/qtbase/lib
$$[QT_INSTALL_LIBS/get]
is the read location and
$$[QT_INSTALL_LIBS]
the
write location when installing Qt libraries. That's analogous for other path properties.
There's a fallback mechanism in place: if there's no
/get
property, it has the value of the
/raw
property. In qt.conf,
/get
properties correspond to the
[EffectivePaths]
section.
/src
properties
/src
Now, in-source builds are inconvenient if you need multiple builds of the same sources. Let's git-clean and do an out-of-source build (aka shadow build).
~/dev/qt/5.12-build/qtbase $ ../../qtbase/configure
...
~/dev/qt/5.12-build/qtbase$ ./bin/qmake -query
QT_SYSROOT:
QT_INSTALL_PREFIX:/opt/Qt/5.12.3
QT_INSTALL_PREFIX/get:/home/someone/dev/qt/5.12-build/qtbase
QT_INSTALL_PREFIX/src:/home/someone/dev/qt/5.12/qtbase
QT_INSTALL_ARCHDATA:/opt/Qt/5.12.3
QT_INSTALL_ARCHDATA/get:/home/someone/dev/qt/5.12-build/qtbase
QT_INSTALL_ARCHDATA/src:/home/someone/dev/qt/5.12/qtbase
QT_INSTALL_DATA:/opt/Qt/5.12.3
QT_INSTALL_DATA/get:/home/someone/dev/qt/5.12-build/qtbase
QT_INSTALL_DATA/src:/home/someone/dev/qt/5.12/qtbase
QT_INSTALL_DOCS:/opt/Qt/5.12.3/doc
QT_INSTALL_DOCS/get:/home/someone/dev/qt/5.12-build/qtbase/doc
QT_INSTALL_DOCS/src:/home/someone/dev/qt/5.12/qtbase/doc
QT_INSTALL_HEADERS:/opt/Qt/5.12.3/include
QT_INSTALL_HEADERS/get:/home/someone/dev/qt/5.12-build/qtbase/include
QT_INSTALL_HEADERS/src:/home/someone/dev/qt/5.12/qtbase/include
QT_INSTALL_LIBS:/opt/Qt/5.12.3/lib
QT_INSTALL_LIBS/get:/home/someone/dev/qt/5.12-build/qtbase/lib
QT_INSTALL_LIBS/src:/home/someone/dev/qt/5.12/qtbase/lib
QT_INSTALL_LIBEXECS:/opt/Qt/5.12.3/libexec
QT_INSTALL_LIBEXECS/get:/home/someone/dev/qt/5.12-build/qtbase/libexec
QT_INSTALL_LIBEXECS/src:/home/someone/dev/qt/5.12/qtbase/libexec
QT_INSTALL_BINS:/opt/Qt/5.12.3/bin
QT_INSTALL_BINS/get:/home/someone/dev/qt/5.12-build/qtbase/bin
QT_INSTALL_BINS/src:/home/someone/dev/qt/5.12/qtbase/bin
QT_INSTALL_TESTS:/opt/Qt/5.12.3/tests
QT_INSTALL_TESTS/get:/home/someone/dev/qt/5.12-build/qtbase/tests
QT_INSTALL_TESTS/src:/home/someone/dev/qt/5.12/qtbase/tests
QT_INSTALL_PLUGINS:/opt/Qt/5.12.3/plugins
QT_INSTALL_PLUGINS/get:/home/someone/dev/qt/5.12-build/qtbase/plugins
QT_INSTALL_PLUGINS/src:/home/someone/dev/qt/5.12/qtbase/plugins
QT_INSTALL_IMPORTS:/opt/Qt/5.12.3/imports
QT_INSTALL_IMPORTS/get:/home/someone/dev/qt/5.12-build/qtbase/imports
QT_INSTALL_IMPORTS/src:/home/someone/dev/qt/5.12/qtbase/imports
QT_INSTALL_QML:/opt/Qt/5.12.3/qml
QT_INSTALL_QML/get:/home/someone/dev/qt/5.12-build/qtbase/qml
QT_INSTALL_QML/src:/home/someone/dev/qt/5.12/qtbase/qml
QT_INSTALL_TRANSLATIONS:/opt/Qt/5.12.3/translations
QT_INSTALL_TRANSLATIONS/get:/home/someone/dev/qt/5.12-build/qtbase/translations
QT_INSTALL_TRANSLATIONS/src:/home/someone/dev/qt/5.12/qtbase/translations
QT_INSTALL_CONFIGURATION:/opt/Qt/5.12.3
QT_INSTALL_CONFIGURATION/get:/home/someone/dev/qt/5.12-build/qtbase
QT_INSTALL_CONFIGURATION/src:/home/someone/dev/qt/5.12/qtbase
QT_INSTALL_EXAMPLES:/opt/Qt/5.12.3/examples
QT_INSTALL_EXAMPLES/get:/home/someone/dev/qt/5.12-build/qtbase/examples
QT_INSTALL_EXAMPLES/src:/home/someone/dev/qt/5.12/qtbase/examples
QT_INSTALL_DEMOS:/opt/Qt/5.12.3/examples
QT_INSTALL_DEMOS/get:/home/someone/dev/qt/5.12-build/qtbase/examples
QT_INSTALL_DEMOS/src:/home/someone/dev/qt/5.12/qtbase/examples
QT_HOST_PREFIX:/opt/Qt/5.12.3
QT_HOST_PREFIX/get:/home/someone/dev/qt/5.12-build/qtbase
QT_HOST_PREFIX/src:/home/someone/dev/qt/5.12/qtbase
QT_HOST_DATA:/opt/Qt/5.12.3
QT_HOST_DATA/get:/home/someone/dev/qt/5.12-build/qtbase
QT_HOST_DATA/src:/home/someone/dev/qt/5.12/qtbase
QT_HOST_BINS:/opt/Qt/5.12.3/bin
QT_HOST_BINS/get:/home/someone/dev/qt/5.12-build/qtbase/bin
QT_HOST_BINS/src:/home/someone/dev/qt/5.12/qtbase/bin
QT_HOST_LIBS:/opt/Qt/5.12.3/lib
QT_HOST_LIBS/get:/home/someone/dev/qt/5.12-build/qtbase/lib
QT_HOST_LIBS/src:/home/someone/dev/qt/5.12/qtbase/lib
QMAKE_SPEC:linux-g++
QMAKE_XSPEC:linux-g++
QMAKE_VERSION:3.1
QT_VERSION:5.12.3
Now we have an additional
/src
property variant that points to the source tree! Whenever Qt's build system must refer to something that's in the source tree, like mkspecs, it queries the
/src
variant of the respective property. Fallback mechanism: If there's no
/src
property set, the
/get
variant is returned. In
qt.conf
,
/src
properties correspond to the
[EffectiveSourcePaths]
section.
/raw
properties
/raw
If Qt is cross-built and
-sysroot
was passed to configure, regular properties and their
/get
variants will have values with the sysroot prepended.
Consider a Qt build for Raspberry Pi:
configure ... -static -xplatform devices/linux-rasp-pi2-g++ \
-sysroot /home/someone/Qt/5.11.3/Boot2Qt/raspberrypi3/toolchain/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi \
-device-option CROSS_COMPILE=/home/someone/Qt/5.11.3/Boot2Qt/raspberrypi3/toolchain/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi- \
-prefix /opt/Qt/raspi \
-hostprefix ~/Qt/raspi
Let's query qmake again.
~/dev/qt/5.12-raspi/qtbase$ ./bin/qmake -query
QT_SYSROOT:/home/someone/Qt/5.11.3/Boot2Qt/raspberrypi3/toolchain/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi
QT_INSTALL_PREFIX:/home/someone/Qt/5.11.3/Boot2Qt/raspberrypi3/toolchain/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/opt/Qt/raspi
QT_INSTALL_PREFIX/raw:/opt/Qt/raspi
QT_INSTALL_PREFIX/get:/home/someone/dev/qt/5.12-raspi/qtbase
QT_INSTALL_PREFIX/src:/home/someone/dev/qt/5.12/qtbase
QT_INSTALL_ARCHDATA:/home/someone/Qt/5.11.3/Boot2Qt/raspberrypi3/toolchain/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/opt/Qt/raspi
QT_INSTALL_ARCHDATA/raw:/opt/Qt/raspi
QT_INSTALL_ARCHDATA/get:/home/someone/Qt/5.11.3/Boot2Qt/raspberrypi3/toolchain/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/home/someone/dev/qt/5.12-raspi/qtbase
QT_INSTALL_ARCHDATA/src:/home/someone/dev/qt/5.12/qtbase
QT_INSTALL_DATA:/home/someone/Qt/5.11.3/Boot2Qt/raspberrypi3/toolchain/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/opt/Qt/raspi
QT_INSTALL_DATA/raw:/opt/Qt/raspi
QT_INSTALL_DATA/get:/home/someone/Qt/5.11.3/Boot2Qt/raspberrypi3/toolchain/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/home/someone/dev/qt/5.12-raspi/qtbase
QT_INSTALL_DATA/src:/home/someone/dev/qt/5.12/qtbase
QT_INSTALL_DOCS:/home/someone/Qt/5.11.3/Boot2Qt/raspberrypi3/toolchain/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/opt/Qt/raspi/doc
QT_INSTALL_DOCS/raw:/opt/Qt/raspi/doc
QT_INSTALL_DOCS/get:/home/someone/Qt/5.11.3/Boot2Qt/raspberrypi3/toolchain/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/home/someone/dev/qt/5.12-raspi/qtbase/doc
QT_INSTALL_DOCS/src:/home/someone/dev/qt/5.12/qtbase/doc
QT_INSTALL_HEADERS:/home/someone/Qt/5.11.3/Boot2Qt/raspberrypi3/toolchain/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/opt/Qt/raspi/include
QT_INSTALL_HEADERS/raw:/opt/Qt/raspi/include
QT_INSTALL_HEADERS/get:/home/someone/Qt/5.11.3/Boot2Qt/raspberrypi3/toolchain/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/home/someone/dev/qt/5.12-raspi/qtbase/include
QT_INSTALL_HEADERS/src:/home/someone/dev/qt/5.12/qtbase/include
QT_INSTALL_LIBS:/home/someone/Qt/5.11.3/Boot2Qt/raspberrypi3/toolchain/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/opt/Qt/raspi/lib
QT_INSTALL_LIBS/raw:/opt/Qt/raspi/lib
QT_INSTALL_LIBS/get:/home/someone/Qt/5.11.3/Boot2Qt/raspberrypi3/toolchain/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/home/someone/dev/qt/5.12-raspi/qtbase/lib
QT_INSTALL_LIBS/src:/home/someone/dev/qt/5.12/qtbase/lib
QT_INSTALL_LIBEXECS:/home/someone/Qt/5.11.3/Boot2Qt/raspberrypi3/toolchain/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/opt/Qt/raspi/libexec
QT_INSTALL_LIBEXECS/raw:/opt/Qt/raspi/libexec
QT_INSTALL_LIBEXECS/get:/home/someone/Qt/5.11.3/Boot2Qt/raspberrypi3/toolchain/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/home/someone/dev/qt/5.12-raspi/qtbase/libexec
QT_INSTALL_LIBEXECS/src:/home/someone/dev/qt/5.12/qtbase/libexec
QT_INSTALL_BINS:/home/someone/Qt/5.11.3/Boot2Qt/raspberrypi3/toolchain/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/opt/Qt/raspi/bin
QT_INSTALL_BINS/raw:/opt/Qt/raspi/bin
QT_INSTALL_BINS/get:/home/someone/Qt/5.11.3/Boot2Qt/raspberrypi3/toolchain/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/home/someone/dev/qt/5.12-raspi/qtbase/bin
QT_INSTALL_BINS/src:/home/someone/dev/qt/5.12/qtbase/bin
QT_INSTALL_TESTS:/home/someone/Qt/5.11.3/Boot2Qt/raspberrypi3/toolchain/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/opt/Qt/raspi/tests
QT_INSTALL_TESTS/raw:/opt/Qt/raspi/tests
QT_INSTALL_TESTS/get:/home/someone/Qt/5.11.3/Boot2Qt/raspberrypi3/toolchain/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/home/someone/dev/qt/5.12-raspi/qtbase/tests
QT_INSTALL_TESTS/src:/home/someone/dev/qt/5.12/qtbase/tests
QT_INSTALL_PLUGINS:/home/someone/Qt/5.11.3/Boot2Qt/raspberrypi3/toolchain/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/opt/Qt/raspi/plugins
QT_INSTALL_PLUGINS/raw:/opt/Qt/raspi/plugins
QT_INSTALL_PLUGINS/get:/home/someone/Qt/5.11.3/Boot2Qt/raspberrypi3/toolchain/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/home/someone/dev/qt/5.12-raspi/qtbase/plugins
QT_INSTALL_PLUGINS/src:/home/someone/dev/qt/5.12/qtbase/plugins
QT_INSTALL_IMPORTS:/home/someone/Qt/5.11.3/Boot2Qt/raspberrypi3/toolchain/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/opt/Qt/raspi/imports
QT_INSTALL_IMPORTS/raw:/opt/Qt/raspi/imports
QT_INSTALL_IMPORTS/get:/home/someone/Qt/5.11.3/Boot2Qt/raspberrypi3/toolchain/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/home/someone/dev/qt/5.12-raspi/qtbase/imports
QT_INSTALL_IMPORTS/src:/home/someone/dev/qt/5.12/qtbase/imports
QT_INSTALL_QML:/home/someone/Qt/5.11.3/Boot2Qt/raspberrypi3/toolchain/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/opt/Qt/raspi/qml
QT_INSTALL_QML/raw:/opt/Qt/raspi/qml
QT_INSTALL_QML/get:/home/someone/Qt/5.11.3/Boot2Qt/raspberrypi3/toolchain/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/home/someone/dev/qt/5.12-raspi/qtbase/qml
QT_INSTALL_QML/src:/home/someone/dev/qt/5.12/qtbase/qml
QT_INSTALL_TRANSLATIONS:/home/someone/Qt/5.11.3/Boot2Qt/raspberrypi3/toolchain/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/opt/Qt/raspi/translations
QT_INSTALL_TRANSLATIONS/raw:/opt/Qt/raspi/translations
QT_INSTALL_TRANSLATIONS/get:/home/someone/Qt/5.11.3/Boot2Qt/raspberrypi3/toolchain/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/home/someone/dev/qt/5.12-raspi/qtbase/translations
QT_INSTALL_TRANSLATIONS/src:/home/someone/dev/qt/5.12/qtbase/translations
QT_INSTALL_CONFIGURATION:/home/someone/Qt/5.11.3/Boot2Qt/raspberrypi3/toolchain/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/opt/Qt/raspi
QT_INSTALL_CONFIGURATION/raw:/opt/Qt/raspi
QT_INSTALL_CONFIGURATION/get:/home/someone/Qt/5.11.3/Boot2Qt/raspberrypi3/toolchain/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/home/someone/dev/qt/5.12-raspi/qtbase
QT_INSTALL_CONFIGURATION/src:/home/someone/dev/qt/5.12/qtbase
QT_INSTALL_EXAMPLES:/home/someone/Qt/5.11.3/Boot2Qt/raspberrypi3/toolchain/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/opt/Qt/raspi/examples
QT_INSTALL_EXAMPLES/raw:/opt/Qt/raspi/examples
QT_INSTALL_EXAMPLES/get:/home/someone/Qt/5.11.3/Boot2Qt/raspberrypi3/toolchain/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/home/someone/dev/qt/5.12-raspi/qtbase/examples
QT_INSTALL_EXAMPLES/src:/home/someone/dev/qt/5.12/qtbase/examples
QT_INSTALL_DEMOS:/home/someone/Qt/5.11.3/Boot2Qt/raspberrypi3/toolchain/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/opt/Qt/raspi/examples
QT_INSTALL_DEMOS/raw:/opt/Qt/raspi/examples
QT_INSTALL_DEMOS/get:/home/someone/Qt/5.11.3/Boot2Qt/raspberrypi3/toolchain/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/home/someone/dev/qt/5.12-raspi/qtbase/examples
QT_INSTALL_DEMOS/src:/home/someone/dev/qt/5.12/qtbase/examples
QT_HOST_PREFIX:/home/someone/Qt/raspi
QT_HOST_PREFIX/get:/home/someone/dev/qt/5.12-raspi/qtbase
QT_HOST_PREFIX/src:/home/someone/dev/qt/5.12/qtbase
QT_HOST_DATA:/home/someone/Qt/raspi
QT_HOST_DATA/get:/home/someone/dev/qt/5.12-raspi/qtbase
QT_HOST_DATA/src:/home/someone/dev/qt/5.12/qtbase
QT_HOST_BINS:/home/someone/Qt/raspi/bin
QT_HOST_BINS/get:/home/someone/dev/qt/5.12-raspi/qtbase/bin
QT_HOST_BINS/src:/home/someone/dev/qt/5.12/qtbase/bin
QT_HOST_LIBS:/home/someone/Qt/raspi/lib
QT_HOST_LIBS/get:/home/someone/dev/qt/5.12-raspi/qtbase/lib
QT_HOST_LIBS/src:/home/someone/dev/qt/5.12/qtbase/lib
QMAKE_SPEC:linux-g++
QMAKE_XSPEC:devices/linux-rasp-pi2-g++
QMAKE_VERSION:3.1
QT_VERSION:5.12.4
It can be easily observed that
/raw
properties are just regular properties or their
/get
variants without the sysroot.
/raw
properties only exist if automatic sysrootification is in effect (which is probably a bug).
Automatic Sysrootification
If automatic sysrootification is enabled, regular properties (and potentially their
/get
property variants) get the sysroot automatically prepended. It's enabled by putting
SysrootifyPrefix=true
into qt.conf in the
[Paths]
section.
The automatic sysrootification is only enabled if and only if all of the bullet points below are true:
- sysroot is set
- prefix is set
- extprefix is *not* set
Surprising, isn't it?
The
qt.conf
from the Raspberry Pi build from above looks like this:
[EffectivePaths]
Prefix=..
[DevicePaths]
Prefix=/opt/Qt/raspi
[Paths]
Prefix=/opt/Qt/raspi
HostPrefix=/home/someone/Qt/raspi
Sysroot=/home/someone/Qt/5.11.3/Boot2Qt/raspberrypi3/toolchain/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi
SysrootifyPrefix=true
TargetSpec=devices/linux-rasp-pi2-g++
HostSpec=linux-g++
[EffectiveSourcePaths]
Prefix=/home/someone/dev/qt/5.12/qtbase
/raw
properties have no direct corresponding section in qt.conf. They're the "write location without the sysroot", e.g. they conceptionally belong to the
[Paths]
section.
/dev
properties Now consider the Raspberry Pi build from above with an additional
-extprefix
option:
configure ... -extprefix /home/someone/Qt/5.11.3/Boot2Qt/raspberrypi3/toolchain/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/mnt/somewhere
Let's query qmake again.
/dev/qt/5.12-raspi$ ./qtbase/bin/qmake -query
QT_INSTALL_LIBS:/tmp/schmutz
QT_SYSROOT:/home/someone/Qt/5.11.3/Boot2Qt/raspberrypi3/toolchain/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi
QT_INSTALL_PREFIX:/home/someone/Qt/5.11.3/Boot2Qt/raspberrypi3/toolchain/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/mnt/somewhere
QT_INSTALL_PREFIX/get:/home/someone/dev/qt/5.12-raspi/qtbase
QT_INSTALL_PREFIX/src:/home/someone/dev/qt/5.12/qtbase
QT_INSTALL_PREFIX/dev:/opt/Qt/raspi
QT_INSTALL_ARCHDATA:/home/someone/Qt/5.11.3/Boot2Qt/raspberrypi3/toolchain/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/mnt/somewhere
QT_INSTALL_ARCHDATA/get:/home/someone/dev/qt/5.12-raspi/qtbase
QT_INSTALL_ARCHDATA/src:/home/someone/dev/qt/5.12/qtbase
QT_INSTALL_ARCHDATA/dev:/opt/Qt/raspi
QT_INSTALL_DATA:/home/someone/Qt/5.11.3/Boot2Qt/raspberrypi3/toolchain/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/mnt/somewhere
QT_INSTALL_DATA/get:/home/someone/dev/qt/5.12-raspi/qtbase
QT_INSTALL_DATA/src:/home/someone/dev/qt/5.12/qtbase
QT_INSTALL_DATA/dev:/opt/Qt/raspi
QT_INSTALL_DOCS:/home/someone/Qt/5.11.3/Boot2Qt/raspberrypi3/toolchain/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/mnt/somewhere/doc
QT_INSTALL_DOCS/get:/home/someone/dev/qt/5.12-raspi/qtbase/doc
QT_INSTALL_DOCS/src:/home/someone/dev/qt/5.12/qtbase/doc
QT_INSTALL_DOCS/dev:/opt/Qt/raspi/doc
QT_INSTALL_HEADERS:/home/someone/Qt/5.11.3/Boot2Qt/raspberrypi3/toolchain/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/mnt/somewhere/include
QT_INSTALL_HEADERS/get:/home/someone/dev/qt/5.12-raspi/qtbase/include
QT_INSTALL_HEADERS/src:/home/someone/dev/qt/5.12/qtbase/include
QT_INSTALL_HEADERS/dev:/opt/Qt/raspi/include
QT_INSTALL_LIBS:/home/someone/Qt/5.11.3/Boot2Qt/raspberrypi3/toolchain/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/mnt/somewhere/lib
QT_INSTALL_LIBS/get:/home/someone/dev/qt/5.12-raspi/qtbase/lib
QT_INSTALL_LIBS/src:/home/someone/dev/qt/5.12/qtbase/lib
QT_INSTALL_LIBS/dev:/opt/Qt/raspi/lib
QT_INSTALL_LIBEXECS:/home/someone/Qt/5.11.3/Boot2Qt/raspberrypi3/toolchain/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/mnt/somewhere/libexec
QT_INSTALL_LIBEXECS/get:/home/someone/dev/qt/5.12-raspi/qtbase/libexec
QT_INSTALL_LIBEXECS/src:/home/someone/dev/qt/5.12/qtbase/libexec
QT_INSTALL_LIBEXECS/dev:/opt/Qt/raspi/libexec
QT_INSTALL_BINS:/home/someone/Qt/5.11.3/Boot2Qt/raspberrypi3/toolchain/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/mnt/somewhere/bin
QT_INSTALL_BINS/get:/home/someone/dev/qt/5.12-raspi/qtbase/bin
QT_INSTALL_BINS/src:/home/someone/dev/qt/5.12/qtbase/bin
QT_INSTALL_BINS/dev:/opt/Qt/raspi/bin
QT_INSTALL_TESTS:/home/someone/Qt/5.11.3/Boot2Qt/raspberrypi3/toolchain/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/mnt/somewhere/tests
QT_INSTALL_TESTS/get:/home/someone/dev/qt/5.12-raspi/qtbase/tests
QT_INSTALL_TESTS/src:/home/someone/dev/qt/5.12/qtbase/tests
QT_INSTALL_TESTS/dev:/opt/Qt/raspi/tests
QT_INSTALL_PLUGINS:/home/someone/Qt/5.11.3/Boot2Qt/raspberrypi3/toolchain/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/mnt/somewhere/plugins
QT_INSTALL_PLUGINS/get:/home/someone/dev/qt/5.12-raspi/qtbase/plugins
QT_INSTALL_PLUGINS/src:/home/someone/dev/qt/5.12/qtbase/plugins
QT_INSTALL_PLUGINS/dev:/opt/Qt/raspi/plugins
QT_INSTALL_IMPORTS:/home/someone/Qt/5.11.3/Boot2Qt/raspberrypi3/toolchain/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/mnt/somewhere/imports
QT_INSTALL_IMPORTS/get:/home/someone/dev/qt/5.12-raspi/qtbase/imports
QT_INSTALL_IMPORTS/src:/home/someone/dev/qt/5.12/qtbase/imports
QT_INSTALL_IMPORTS/dev:/opt/Qt/raspi/imports
QT_INSTALL_QML:/home/someone/Qt/5.11.3/Boot2Qt/raspberrypi3/toolchain/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/mnt/somewhere/qml
QT_INSTALL_QML/get:/home/someone/dev/qt/5.12-raspi/qtbase/qml
QT_INSTALL_QML/src:/home/someone/dev/qt/5.12/qtbase/qml
QT_INSTALL_QML/dev:/opt/Qt/raspi/qml
QT_INSTALL_TRANSLATIONS:/home/someone/Qt/5.11.3/Boot2Qt/raspberrypi3/toolchain/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/mnt/somewhere/translations
QT_INSTALL_TRANSLATIONS/get:/home/someone/dev/qt/5.12-raspi/qtbase/translations
QT_INSTALL_TRANSLATIONS/src:/home/someone/dev/qt/5.12/qtbase/translations
QT_INSTALL_TRANSLATIONS/dev:/opt/Qt/raspi/translations
QT_INSTALL_CONFIGURATION:/home/someone/Qt/5.11.3/Boot2Qt/raspberrypi3/toolchain/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/mnt/somewhere
QT_INSTALL_CONFIGURATION/get:/home/someone/dev/qt/5.12-raspi/qtbase
QT_INSTALL_CONFIGURATION/src:/home/someone/dev/qt/5.12/qtbase
QT_INSTALL_CONFIGURATION/dev:/opt/Qt/raspi
QT_INSTALL_EXAMPLES:/home/someone/Qt/5.11.3/Boot2Qt/raspberrypi3/toolchain/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/mnt/somewhere/examples
QT_INSTALL_EXAMPLES/get:/home/someone/dev/qt/5.12-raspi/qtbase/examples
QT_INSTALL_EXAMPLES/src:/home/someone/dev/qt/5.12/qtbase/examples
QT_INSTALL_EXAMPLES/dev:/opt/Qt/raspi/examples
QT_INSTALL_DEMOS:/home/someone/Qt/5.11.3/Boot2Qt/raspberrypi3/toolchain/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/mnt/somewhere/examples
QT_INSTALL_DEMOS/get:/home/someone/dev/qt/5.12-raspi/qtbase/examples
QT_INSTALL_DEMOS/src:/home/someone/dev/qt/5.12/qtbase/examples
QT_INSTALL_DEMOS/dev:/opt/Qt/raspi/examples
QT_HOST_PREFIX:/home/someone/Qt/raspi
QT_HOST_PREFIX/get:/home/someone/dev/qt/5.12-raspi/qtbase
QT_HOST_PREFIX/src:/home/someone/dev/qt/5.12/qtbase
QT_HOST_DATA:/home/someone/Qt/raspi
QT_HOST_DATA/get:/home/someone/dev/qt/5.12-raspi/qtbase
QT_HOST_DATA/src:/home/someone/dev/qt/5.12/qtbase
QT_HOST_BINS:/home/someone/Qt/raspi/bin
QT_HOST_BINS/get:/home/someone/dev/qt/5.12-raspi/qtbase/bin
QT_HOST_BINS/src:/home/someone/dev/qt/5.12/qtbase/bin
QT_HOST_LIBS:/home/someone/Qt/raspi/lib
QT_HOST_LIBS/get:/home/someone/dev/qt/5.12-raspi/qtbase/lib
QT_HOST_LIBS/src:/home/someone/dev/qt/5.12/qtbase/lib
QMAKE_SPEC:linux-g++
QMAKE_XSPEC:devices/linux-rasp-pi2-g++
QMAKE_VERSION:3.1
QT_VERSION:5.12.4
The
/raw
properties are gone, and
/dev
properties have appeared. The
/dev
property variants are paths as seen on the device. In qt.conf,
/dev
properties correspond to the
[DevicePaths]
section.