Fix linking against Qt5 on MSVC 69/head
authorHendrik Leppkes <h.leppkes@gmail.com>
Sat, 29 Mar 2014 16:18:22 +0000 (17:18 +0100)
committerHendrik Leppkes <h.leppkes@gmail.com>
Sat, 29 Mar 2014 16:18:22 +0000 (17:18 +0100)
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

index 3033e60..b57061a 100644 (file)
@@ -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)
     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)
   endif(MSVC)
   if(HAVE_SSL AND STATIC)
      find_package(OpenSSL REQUIRED)