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.

Fixes: QTBUG-91405
Change-Id: I07efb4afb51ba69d2f5467d272118fa51637ab54
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 52077d4f0193a236eacac98f75994b44a4c30a91)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Joerg Bornemann 2021-04-26 15:05:24 +02:00 committed by Qt Cherry-pick Bot
parent 5b9e896eaa
commit d12a395f33

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")
@ -47,7 +49,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 "")