summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cmake/QtQmakeHelpers.cmake17
-rw-r--r--src/corelib/global/qconfig.cpp.in2
2 files changed, 18 insertions, 1 deletions
diff --git a/cmake/QtQmakeHelpers.cmake b/cmake/QtQmakeHelpers.cmake
index f64032a77d..0a2c5b1531 100644
--- a/cmake/QtQmakeHelpers.cmake
+++ b/cmake/QtQmakeHelpers.cmake
@@ -66,6 +66,23 @@ function(qt_generate_qconfig_cpp in_file out_file)
"${lib_location_absolute_path}" "${QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX}")
set(QT_CONFIGURE_LIBLOCATION_TO_PREFIX_PATH "${from_lib_location_to_prefix}")
+ # Ensure Windows drive letter is prepended to the install prefix hardcoded
+ # into qconfig.cpp, otherwise qmake can't find Qt modules in a static Qt
+ # build if there's no qt.conf. Mostly relevant for CI.
+ # Given input like
+ # \work/qt/install
+ # or
+ # \work\qt\install
+ # Expected output is something like
+ # C:/work/qt/install
+ # so it includes a drive letter and forward slashes.
+ set(QT_CONFIGURE_PREFIX_PATH_STR "${QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX}")
+ if(WIN32)
+ get_filename_component(
+ QT_CONFIGURE_PREFIX_PATH_STR
+ "${QT_CONFIGURE_PREFIX_PATH_STR}" REALPATH)
+ endif()
+
configure_file(${in_file} ${out_file} @ONLY)
endfunction()
diff --git a/src/corelib/global/qconfig.cpp.in b/src/corelib/global/qconfig.cpp.in
index a552f6bfff..e6a85feffd 100644
--- a/src/corelib/global/qconfig.cpp.in
+++ b/src/corelib/global/qconfig.cpp.in
@@ -13,7 +13,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@";
static const short qt_configure_str_offsets[] = {
@QT_CONFIG_STR_OFFSETS_FIRST@
};