Inhibit CMake generator detection for qt-configure-module

When configuring a Qt module with qt-configure-module, we want to use
the same CMake generator that was used for building qtbase.
That generator is encoded in qt-cmake-private. But qt-configure-module
overrides the generator after trying to detect what generator should be
used. That auto-detection is only useful for qtbase-builds and top-level
builds. Turn it off for repo builds other than qtbase.

Pick-to: 6.1
Fixes: QTBUG-91405
Change-Id: I07efb4afb51ba69d2f5467d272118fa51637ab54
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
bb10
Joerg Bornemann 2021-04-26 15:05:24 +02:00
parent 7d48b64f41
commit 52077d4f01
1 changed files with 2 additions and 1 deletions

View File

@ -28,8 +28,10 @@ endmacro()
if("${MODULE_ROOT}" STREQUAL "")
# If MODULE_ROOT is not set, assume that we want to build qtbase or top-level.
get_filename_component(MODULE_ROOT ".." ABSOLUTE BASE_DIR "${CMAKE_CURRENT_LIST_DIR}")
set(auto_detect_generator TRUE)
else()
file(TO_CMAKE_PATH "${MODULE_ROOT}" MODULE_ROOT)
set(auto_detect_generator FALSE)
endif()
set(configure_filename "configure.cmake")
set(commandline_filename "qt_cmdline.cmake")
@ -54,7 +56,6 @@ list(FILTER configure_args EXCLUDE REGEX "^[ \t]*$")
list(TRANSFORM configure_args STRIP)
list(TRANSFORM configure_args REPLACE "\\\\" "\\\\\\\\")
unset(generator)
set(auto_detect_generator TRUE)
set(auto_detect_compiler TRUE)
unset(device_options)
set_property(GLOBAL PROPERTY UNHANDLED_ARGS "")