From fe475ab0bffc906862d129e432a738973fa2b743 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Sat, 29 Mar 2014 17:18:22 +0100 Subject: [PATCH] Fix linking against Qt5 on MSVC QT_QTMAIN_LIBRARY is no longer automatically set on Qt5, as it is part of a deprecated way to link against Qt. Since Quassel needs to support both Qt4 and Qt5, setting the variable to the appropriate value again works around the issue until such a time that the CMake requirement is increased to make use of policy CMP0020. Note that this is the same workaround cmake itself uses when building cmake-gui for Windows. --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3033e600..b57061af 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -452,6 +452,9 @@ if(WIN32) set(CMAKE_EXE_LINKER_FLAGS_DEBUG "/debug /INCREMENTAL:YES /NODEFAULTLIB:libcmt") set(CMAKE_EXE_LINKER_FLAGS_DEBUGFULL "${CMAKE_EXE_LINKER_FLAGS_DEBUG}") link_libraries(Version dwmapi shlwapi) + if(USE_QT5) + set(QT_QTMAIN_LIBRARY Qt5::WinMain) + endif(USE_QT5) endif(MSVC) if(HAVE_SSL AND STATIC) find_package(OpenSSL REQUIRED) -- 2.20.1