From: Hendrik Leppkes Date: Sat, 29 Mar 2014 16:18:22 +0000 (+0100) Subject: Fix linking against Qt5 on MSVC X-Git-Tag: 0.11.0~44^2 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=fe475ab0bffc906862d129e432a738973fa2b743 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. --- 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)