diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2021-03-23 17:47:58 +0100 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2021-03-26 13:31:21 +0100 |
commit | 9d1b1c71b29ed4c84195093c68c45f77796fb62f (patch) | |
tree | 18cad899d88c81ebb5d00ae57ebf3104fc77a5a1 /src/corelib | |
parent | 33fe70d5144af6daa141004a7bd4b2b7aa2002cc (diff) |
CMake: Fix qconfig.cpp embedded prefix in the CI
In the CI on a windows we configure Qt with the following prefix
-DCMAKE_INSTALL_PREFIX:PATH=\Users\qt\work\install
Note the lack of the drive letter.
This is intentional, so that we can abuse CMake's DESTDIR installation
mechanism to install into a custom path.
This causes trouble for static Qt builds in the CI.
Specifically when there is no qt.conf file next to qmake, qmake -query
will report a
QT_INSTALL_PREFIX:/Users/qt/work/install
and ultimately qmake will fail to locate the module .pri files in such
a path, showing errors like:
Project ERROR: Unknown module(s) in QT: core gui?
If a qt.conf is placed next to qmake (even an empty one), a differenct
code path is used in qmake to resolve the prefix, which returns a path
with a drive letter.
In a shared build, because the 'relocatable' feature is enabled by
default, a different code path is used and thus the prefix is
also successfully resolved.
So the problem is specific to static Windows Qt builds that have no
qt.conf file next to qmake.
This is the exact scenario that we encounter when running static
Qt tests (tst_qmake in particular).
To circumvent the issue, prepend a drive letter to the prefix
hardcoded into qconfig.cpp. Do that with
get_filename_component(REALPATH) which apparently resolves
to a fully qualified path.
Task-number: QTBUG-87580
Change-Id: I17c885f29bfdee45bec1d6aac7c3b26723e761a3
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 59c3be711728ab0aa644bfdf50e91a1b020f95bb)
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/global/qconfig.cpp.in | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/global/qconfig.cpp.in b/src/corelib/global/qconfig.cpp.in index 664924abec..19689e2909 100644 --- a/src/corelib/global/qconfig.cpp.in +++ b/src/corelib/global/qconfig.cpp.in @@ -1,7 +1,7 @@ /* Installation date */ static const char qt_configure_installation [12+11] = "qt_instdate=2012-12-20"; /* Installation Info */ -static const char qt_configure_prefix_path_str [12+256] = "qt_prfxpath=@QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX@"; +static const char qt_configure_prefix_path_str [12+256] = "qt_prfxpath=@QT_CONFIGURE_PREFIX_PATH_STR@"; #ifdef QT_BUILD_QMAKE static const char qt_configure_ext_prefix_path_str [12+256] = "qt_epfxpath=@QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX@"; static const char qt_configure_host_prefix_path_str [12+256] = "qt_hpfxpath=@QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX@"; |