forked from qt-creator/qt-creator
CMakePM: Fix qmake detection on Windows for CMake import builds
The cross-compiled builds of Qt seem to deliver both qmake and qmake.bat as scripts that point to the host qmake binary. The qmake detection code would look after "qmake qmake.bat" and since both are present "qmake" would be picked. This broke the Qt detection on Windows for Android import builds. This includes CMake presets. Change-Id: I7a0272e721a19926bc58cd50282a3f6de274a05e Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
@@ -546,8 +546,11 @@ static QMakeAndCMakePrefixPath qtInfoFromCMakeCache(const CMakeConfig &config,
|
||||
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core REQUIRED)
|
||||
|
||||
if (CMAKE_CROSSCOMPILING)
|
||||
if (CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
|
||||
set(qmake_script_suffix ".bat")
|
||||
endif()
|
||||
find_program(qmake_binary
|
||||
NAMES qmake qmake.bat
|
||||
NAMES qmake${qmake_script_suffix}
|
||||
PATHS "${Qt${QT_VERSION_MAJOR}_DIR}/../../../bin"
|
||||
NO_DEFAULT_PATH)
|
||||
file(WRITE "${CMAKE_SOURCE_DIR}/qmake-location.txt" "${qmake_binary}")
|
||||
|
Reference in New Issue
Block a user