From e7d12b876ab7d80b0eb983d6d5c90f64bfafed02 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Tue, 26 May 2020 08:34:11 +0200 Subject: [PATCH] Fix qmake builds of Windows applications against a CMake-built Qt QMake's windows.prf expects the WinMain library to be named 'qtmain[d].lib' and not 'Qt6WinMain[d].lib'. We're renaming the library to 'qtmain[d].lib' in the CMake build now to avoid adjusting the qmake build of Qt. Also, we have to add the private library shell32.lib to WinMain to make it appear in qtmain.prl and having it linked to Windows GUI applications. Fixes: QTBUG-84425 Change-Id: Ia94090b89e037b17ebfded359b293c8586371d59 Reviewed-by: Alexandru Croitor --- src/winmain/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/winmain/CMakeLists.txt b/src/winmain/CMakeLists.txt index fb48fec5a3b..fb83894a9fd 100644 --- a/src/winmain/CMakeLists.txt +++ b/src/winmain/CMakeLists.txt @@ -14,12 +14,15 @@ qt_add_module(WinMain $ ) +set_property(TARGET WinMain PROPERTY OUTPUT_NAME qtmain) + qt_extend_target(WinMain CONDITION WINRT SOURCES qtmain_winrt.cpp ) qt_extend_target(WinMain CONDITION NOT WINRT SOURCES qtmain_win.cpp + LIBRARIES shell32 ) qt_extend_target(WinMain CONDITION MINGW