Qmake properties: Difference between revisions
(formatting) |
mNo edit summary |
||
Line 4: | Line 4: | ||
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: | 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: | ||
< | <syntaxhighlight lang="bash"> | ||
$ /usr/local/Qt-5.12.3/bin/qmake -query | $ /usr/local/Qt-5.12.3/bin/qmake -query | ||
QT_SYSROOT: | QT_SYSROOT: | ||
Line 31: | Line 31: | ||
QMAKE_VERSION:3.1 | QMAKE_VERSION:3.1 | ||
QT_VERSION:5.12.3 | QT_VERSION:5.12.3 | ||
</ | </syntaxhighlight> | ||
There's an empty sysroot. The installation prefix is ''/usr/local/Qt-5.12.3''. | There's an empty sysroot. The installation prefix is ''/usr/local/Qt-5.12.3''. | ||
Line 41: | Line 41: | ||
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: | 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: | ||
< | <syntaxhighlight lang="bash"> | ||
~/dev/qt/5.12/qtbase $ configure | ~/dev/qt/5.12/qtbase $ configure | ||
~/dev/qt/5.12/qtbase $ ./bin/qmake -query | ~/dev/qt/5.12/qtbase $ ./bin/qmake -query | ||
Line 89: | Line 89: | ||
QMAKE_VERSION:3.1 | QMAKE_VERSION:3.1 | ||
QT_VERSION:5.12.3 | QT_VERSION:5.12.3 | ||
</ | </syntaxhighlight> | ||
Now we see that some properties got counterparts ending with <code>/get</code>. | Now we see that some properties got counterparts ending with <code>/get</code>. | ||
Line 105: | Line 105: | ||
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). | 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). | ||
< | <syntaxhighlight lang="bash"> | ||
~/dev/qt/5.12-build/qtbase $ ../../qtbase/configure | ~/dev/qt/5.12-build/qtbase $ ../../qtbase/configure | ||
... | ... | ||
Line 174: | Line 174: | ||
QMAKE_VERSION:3.1 | QMAKE_VERSION:3.1 | ||
QT_VERSION:5.12.3 | QT_VERSION:5.12.3 | ||
</ | </syntaxhighlight> | ||
Now we have an additional <code>/src</code> 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 <code>/src</code> variant of the respective property. | Now we have an additional <code>/src</code> 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 <code>/src</code> variant of the respective property. | ||
Line 186: | Line 186: | ||
Consider a Qt build for Raspberry Pi: | Consider a Qt build for Raspberry Pi: | ||
< | <syntaxhighlight lang="bash"> | ||
configure ... -static -xplatform devices/linux-rasp-pi2-g++ \ | 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 \ | -sysroot /home/someone/Qt/5.11.3/Boot2Qt/raspberrypi3/toolchain/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi \ | ||
Line 192: | Line 192: | ||
-prefix /opt/Qt/raspi \ | -prefix /opt/Qt/raspi \ | ||
-hostprefix ~/Qt/raspi | -hostprefix ~/Qt/raspi | ||
</ | </syntaxhighlight> | ||
Let's query qmake again. | Let's query qmake again. | ||
< | <syntaxhighlight lang="bash"> | ||
~/dev/qt/5.12-raspi/qtbase$ ./bin/qmake -query | ~/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_SYSROOT:/home/someone/Qt/5.11.3/Boot2Qt/raspberrypi3/toolchain/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi | ||
Line 279: | Line 279: | ||
QMAKE_VERSION:3.1 | QMAKE_VERSION:3.1 | ||
QT_VERSION:5.12.4 | QT_VERSION:5.12.4 | ||
</ | </syntaxhighlight> | ||
It can be easily observed that <code>/raw</code> properties are just regular properties or their <code>/get</code> variants without the sysroot. | It can be easily observed that <code>/raw</code> properties are just regular properties or their <code>/get</code> variants without the sysroot. | ||
Line 296: | Line 296: | ||
The <code>qt.conf</code> from the Raspberry Pi build from above looks like this: | The <code>qt.conf</code> from the Raspberry Pi build from above looks like this: | ||
< | <syntaxhighlight lang="bash"> | ||
[EffectivePaths] | [EffectivePaths] | ||
Prefix=.. | Prefix=.. | ||
Line 310: | Line 310: | ||
[EffectiveSourcePaths] | [EffectiveSourcePaths] | ||
Prefix=/home/someone/dev/qt/5.12/qtbase | Prefix=/home/someone/dev/qt/5.12/qtbase | ||
</ | </syntaxhighlight> | ||
<code>/raw</code> properties have no direct corresponding section in ''qt.conf''. They're the "write location without the sysroot", e.g. they conceptionally belong to the <code>[Paths]</code> section. | <code>/raw</code> properties have no direct corresponding section in ''qt.conf''. They're the "write location without the sysroot", e.g. they conceptionally belong to the <code>[Paths]</code> section. | ||
Line 318: | Line 318: | ||
Now consider the Raspberry Pi build from above with an additional <code>-extprefix</code> option: | Now consider the Raspberry Pi build from above with an additional <code>-extprefix</code> option: | ||
< | <syntaxhighlight lang="bash"> | ||
configure ... -extprefix /home/someone/Qt/5.11.3/Boot2Qt/raspberrypi3/toolchain/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/mnt/somewhere | configure ... -extprefix /home/someone/Qt/5.11.3/Boot2Qt/raspberrypi3/toolchain/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/mnt/somewhere | ||
</ | </syntaxhighlight> | ||
Let's query qmake again. | Let's query qmake again. | ||
< | <syntaxhighlight lang="bash"> | ||
/dev/qt/5.12-raspi$ ./qtbase/bin/qmake -query | /dev/qt/5.12-raspi$ ./qtbase/bin/qmake -query | ||
QT_INSTALL_LIBS:/tmp/schmutz | QT_INSTALL_LIBS:/tmp/schmutz | ||
Line 408: | Line 408: | ||
QMAKE_VERSION:3.1 | QMAKE_VERSION:3.1 | ||
QT_VERSION:5.12.4 | QT_VERSION:5.12.4 | ||
</ | </syntaxhighlight> | ||
The <code>/raw</code> properties are gone, and <code>/dev</code> properties have appeared. | The <code>/raw</code> properties are gone, and <code>/dev</code> properties have appeared. |
Latest revision as of 10:41, 9 December 2020
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.