From 802811057810a41b3ae8d9a105c061da63ce7fd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20K=C3=BCmmel?= Date: Wed, 9 Dec 2015 16:20:54 +0100 Subject: [PATCH] qtmain also needed for Qt5 on Windows --- CMakeLists.txt | 11 +++++++++-- src/CMakeLists.txt | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5840ad08a0..e1376a45b7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -572,6 +572,9 @@ if(LYX_USE_QT MATCHES "QT5") qt5_wrap_ui(${ARGN}) endmacro() message(STATUS "Found Qt-Version ${QTVERSION}") + if(WIN32) + set(LYX_QTMAIN_LIBRARY ${Qt5Core_QTMAIN_LIBRARIES}) + endif() endif() elseif(LYX_USE_QT MATCHES "QT4") if(LYX_XMINGW) @@ -587,6 +590,9 @@ elseif(LYX_USE_QT MATCHES "QT4") macro (qt_wrap_uifiles) qt4_wrap_ui(${ARGN}) endmacro() + if(WIN32) + set(LYX_QTMAIN_LIBRARY ${QT_QTMAIN_LIBRARIES}) + endif() else() message(FATAL_ERROR "Unhandled value for LYX_USE_QT (${LYX_USE_QT})") endif() @@ -691,9 +697,10 @@ endif() if(WIN32) - if(NOT LYX_CONSOLE) + if(LYX_CONSOLE) + set(LYX_QTMAIN_LIBRARY) + else() set(WIN32_CONSOLE WIN32) - set(LYX_QTMAIN_LIBRARY ${QT_QTMAIN_LIBRARY}) endif() if(MSVC) add_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DNOMINMAX) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c15f09852b..0dc99a72d9 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -129,7 +129,7 @@ target_link_libraries(${_lyx} graphics support ${ICONV_LIBRARY} - ${QT_QTMAIN_LIBRARY} + ${LYX_QTMAIN_LIBRARY} ${vld_dll}) qt_use_modules(${_lyx} Core Gui)