From 9fde85444e457fcd01c56be808d3dd4f06e774ab Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Wed, 4 Jun 2025 09:45:02 +0200 Subject: [PATCH] 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 --- src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp b/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp index 9544a1e2fbe..b03d636b721 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp @@ -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}")