Skip to content
Permalink
Browse files

Fix GUI=QT5 CMake build

Add the possibility of static Qt 5 build of Cool Reader
  • Loading branch information
EXL committed May 10, 2018
1 parent de03a11 commit d9c1f3fd62681dc0ccee554679e2862b977edf04
Showing with 20 additions and 2 deletions.
  1. +1 −1 CMakeLists.txt
  2. +5 −1 cr3qt/CMakeLists.txt
  3. +14 −0 cr3qt/src/main.cpp
@@ -1,5 +1,5 @@
PROJECT(cr3)
cmake_minimum_required(VERSION 2.6)
cmake_minimum_required(VERSION 3.0)

#INCLUDE(CPack)

@@ -150,6 +150,10 @@ else()
ADD_EXECUTABLE(cr3 ${CR3_MAN_PAGES} ${CR3_CHANGELOG} ${CR3_SOURCES} ${CR3_RCS} ${CR3_UI_HDRS} ${CR3_MOC_SRCS} ${QM_FILES} ${RES_FILES})
endif (WIN32)

if( NOT ${GUI} STREQUAL QT )
qt5_use_modules(cr3 Widgets)
endif( NOT ${GUI} STREQUAL QT )

if(WIN32)
if(CMAKE_GENERATOR MATCHES "Visual Studio.*")
message("Visual Studio generator detected")
@@ -173,7 +177,7 @@ IF(MAC)
SET (EXTRA_LIBS ${QT_LIBRARIES} ${STD_LIBS} )
#${QT_LIBRARIES}
ELSEIF (UNIX)
SET (EXTRA_LIBS ${QT_LIBRARIES} fontconfig ${STD_LIBS} )
SET (EXTRA_LIBS ${QT_LIBRARIES} ${Qt5Core_LIBRARIES} ${Qt5Widgets_LIBRARIES} fontconfig ${STD_LIBS} )
ELSE()
SET (EXTRA_LIBS ${STD_LIBS} ${QT_LIBRARIES} ${Qt5Core_LIBRARIES} ${Qt5Widgets_LIBRARIES} )
ENDIF(MAC)
@@ -24,6 +24,20 @@
#include <fontconfig/fontconfig.h>
#endif

#if defined(QT_STATIC)
#if QT_VERSION >= 0x050000
#include <QtPlugin>
#if defined(Q_OS_UNIX)
Q_IMPORT_PLUGIN(QXcbIntegrationPlugin);
#elif defined(Q_OS_WIN)
Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin);
Q_IMPORT_PLUGIN(QWindowsVistaStylePlugin);
#elif defined(Q_OS_MACOS)
Q_IMPORT_PLUGIN(QCocoaIntegrationPlugin);
#endif
#endif
#endif

// prototypes
void InitCREngineLog( const char * cfgfile );
bool InitCREngine( const char * exename, lString16Collection & fontDirs );

0 comments on commit d9c1f3f

Please sign in to comment.
You can’t perform that action at this time.