Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/3rdparty/CMakeLists.txt b/3rdparty/CMakeLists.txt
- index efdd2f8d..42ba2325 100644
- --- a/3rdparty/CMakeLists.txt
- +++ b/3rdparty/CMakeLists.txt
- @@ -1,6 +1,6 @@
- cmake_minimum_required(VERSION 3.1.0)
- -if( USE_WEBENGINE )
- +if( IS_WEBENGINE )
- include(qhttp.cmake)
- endif()
- include(qite/libqite/libqite.cmake)
- diff --git a/CMakeLists.txt b/CMakeLists.txt
- index 593ea132..a8a26180 100644
- --- a/CMakeLists.txt
- +++ b/CMakeLists.txt
- @@ -36,9 +36,7 @@ option( ONLY_PLUGINS "Build psi-plus plugins only" OFF )
- option( USE_HUNSPELL "Build psi-plus with hunspell spellcheck" ON )
- option( USE_ENCHANT "Build psi-plus with enchant spellcheck" OFF )
- option( ENABLE_PLUGINS "Enable plugins" OFF )
- -option( ENABLE_WEBKIT "Enable webkit/webengine support" ON )
- -option( USE_WEBKIT "Use Webkit support instead of WebEngine" OFF )
- -option( USE_WEBENGINE "Use WebEngine support instead of Webkit" OFF )
- +set( CHAT_TYPE "WEBENGINE" CACHE STRING "Type of chatlog engine. WEBKIT | WEBENGINE | BASIC")
- option( USE_CCACHE "Use ccache utility if found" ON )
- option( VERBOSE_PROGRAM_NAME "Verbose output binary name" OFF ) #Experimental
- option( USE_CRASH "Enable builtin sigsegv handling" OFF )
- @@ -79,43 +77,31 @@ set( GLOBAL_DEPENDS_DEBUG_MODE ON )
- set( CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules" )
- -#Detect QtWebEngine if enabled
- -if(ENABLE_WEBKIT)
- +set(IS_WEBKIT OFF CACHE BOOL "Use webkit. Interrnal variable")
- +set(IS_WEBENGINE OFF CACHE BOOL "Use webengine. Interrnal variable")
- +
- +if("${CHAT_TYPE}" STREQUAL "WEBKIT")
- add_definitions(
- -DWEBKIT
- )
- - find_package( Qt5Core REQUIRED )
- - find_package( Qt5 COMPONENTS WebEngine QUIET )
- - if(${Qt5Core_VERSION} VERSION_GREATER 5.6.0)
- - if( Qt5WebEngine_FOUND AND (NOT USE_WEBKIT) )
- - set( USE_WEBENGINE ON )
- - add_definitions(
- - -DWEBENGINE=1
- - )
- - message(STATUS "QtWebEngine - enabled")
- - elseif(USE_WEBENGINE)
- - message(FATAL_ERROR "USE_WEBENGINE flag is enabled but Qt5WebEngine package not found!")
- - else()
- - set( USE_WEBENGINE OFF )
- - endif()
- - endif()
- - message(STATUS "Webkit - enabled")
- + set(IS_WEBKIT ON)
- + message(STATUS "Chatlog type - QtWebKit")
- +elseif("${CHAT_TYPE}" STREQUAL "WEBENGINE")
- + set(IS_WEBENGINE ON)
- + find_package( Qt5Core 5.6.0 REQUIRED )
- + add_definitions(
- + -DWEBKIT
- + -DWEBENGINE=1
- + )
- + message(STATUS "Chatlog type - QtWebEngine")
- +else()
- + set(IS_WEBKIT OFF)
- + set(IS_WEBENGINE OFF)
- + message(STATUS "Chatlog type - Basic")
- endif()
- message(STATUS "SQL history - built-in since 1.4.444 version")
- -if(USE_WEBENGINE AND USE_WEBKIT)
- - message(FATAL_ERROR "Both flags USE_WEBENGINE and USE_WEBKIT cannot be enabled at the same time. Please disable one of them")
- -endif()
- -
- -if(USE_WEBENGINE AND (NOT ENABLE_WEBKIT))
- - message(FATAL_ERROR "USE_WEBENGINE flag is enabled but ENABLE_WEBKIT flag is disabled. Please disable USE_WEBENGINE or enable ENABLE_WEBKIT")
- -endif()
- -
- -if(USE_WEBKIT AND (NOT ENABLE_WEBKIT))
- - message(FATAL_ERROR "USE_WEBKIT flag is enabled but ENABLE_WEBKIT flag is disabled. Please disable USE_WEBKIT or enable ENABLE_WEBKIT")
- -endif()
- -
- if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug" OR ("${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo"))
- set(ISDEBUG ON)
- endif()
- diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
- index d3c3ac2d..005e5c98 100644
- --- a/src/CMakeLists.txt
- +++ b/src/CMakeLists.txt
- @@ -28,15 +28,14 @@ endif()
- set(TRANSLATIONS_DIR "${PROJECT_SOURCE_DIR}/translations")
- find_package(Qt5 COMPONENTS Widgets Core Gui Xml Network Concurrent Multimedia Svg Sql REQUIRED)
- -if(ENABLE_WEBKIT)
- - if(NOT USE_WEBENGINE)
- - find_package(Qt5 COMPONENTS WebKit WebKitWidgets REQUIRED)
- - set(WEBKIT_LIBS Qt5::WebKit Qt5::WebKitWidgets)
- - else()
- - find_package(Qt5 COMPONENTS WebEngine WebEngineWidgets WebChannel REQUIRED)
- - set(WEBKIT_LIBS Qt5::WebEngine Qt5::WebEngineWidgets Qt5::WebChannel)
- - endif()
- +if(IS_WEBKIT)
- + find_package(Qt5 COMPONENTS WebKit WebKitWidgets REQUIRED)
- + set(WEBKIT_LIBS Qt5::WebKit Qt5::WebKitWidgets)
- +elseif(IS_WEBENGINE)
- + find_package(Qt5 COMPONENTS WebEngine WebEngineWidgets WebChannel REQUIRED)
- + set(WEBKIT_LIBS Qt5::WebEngine Qt5::WebEngineWidgets Qt5::WebChannel)
- endif()
- +
- if(USE_KEYCHAIN)
- find_package( Qt5 COMPONENTS Keychain QUIET )
- if( Qt5Keychain_FOUND )
- @@ -81,7 +80,7 @@ set(QT_LIBRARIES Qt5::Widgets Qt5::Core Qt5::Network Qt5::Xml ${WEBKIT_LIBS} Qt5
- if(LINUX)
- list(APPEND QT_LIBRARIES Qt5::DBus Qt5::X11Extras ${LIBXCB_LIBRARIES})
- endif()
- -if(USE_WEBENGINE)
- +if(IS_WEBENGINE)
- list(APPEND EXTRA_LIBS qhttp)
- endif()
- if(APPLE)
- @@ -137,12 +136,10 @@ endif()
- string(TIMESTAMP PSI_COMPILATION_DATE "%Y-%m-%d")
- string(TIMESTAMP PSI_COMPILATION_TIME "%H:%M:%S")
- -if(ENABLE_WEBKIT)
- - if(NOT USE_WEBENGINE)
- - set(PSI_VER_SUFFIX ", webkit")
- - else()
- - set(PSI_VER_SUFFIX ", webengine")
- - endif()
- +if(IS_WEBKIT)
- + set(PSI_VER_SUFFIX ", webkit")
- +elseif(IS_WEBENGINE)
- + set(PSI_VER_SUFFIX ", webengine")
- endif()
- if( NOT IS_PSIPLUS )
- @@ -192,7 +189,7 @@ if(APPLE)
- add_subdirectory(CocoaUtilities)
- endif()
- -if(USE_WEBENGINE)
- +if(IS_WEBENGINE)
- include_directories(
- ${PROJECT_SOURCE_DIR}/3rdparty
- ${PROJECT_SOURCE_DIR}/3rdparty/http-parser
- @@ -314,9 +311,9 @@ include(${PROJECT_SOURCE_DIR}/cmake/modules/fix-codestyle.cmake)
- #Experimental feature
- if(VERBOSE_PROGRAM_NAME)
- - if(ENABLE_WEBKIT AND (NOT USE_WEBENGINE))
- + if(IS_WEBKIT)
- set(VERBOSE_SUFFIX "-webkit")
- - elseif(USE_WEBENGINE)
- + elseif(IS_WEBENGINE)
- set(VERBOSE_SUFFIX "-webengine")
- endif()
- endif()
- @@ -337,7 +334,7 @@ endif()
- set(STANDARD_NUM 14)
- add_dependencies(${PROJECT_NAME} iris)
- -if(USE_WEBENGINE)
- +if(IS_WEBENGINE)
- add_dependencies(${PROJECT_NAME} qhttp)
- endif()
- add_dependencies(${PROJECT_NAME} build_ui_files)
- @@ -350,7 +347,7 @@ if(WIN32 AND MSVC)
- gdi32
- advapi32
- )
- - if(USE_WEBENGINE)
- + if(IS_WEBENGINE)
- list(APPEND EXTRA_LIBS
- imm32
- )
- @@ -407,7 +404,7 @@ set(DOC_FILES
- copy("${PROJECT_SOURCE_DIR}/certs/" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/certs/" prepare-bin)
- copy("${PROJECT_SOURCE_DIR}/iconsets/" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/iconsets/" prepare-bin)
- copy("${PROJECT_SOURCE_DIR}/sound/" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/sound/" prepare-bin)
- -if(ENABLE_WEBKIT)
- +if(IS_WEBKIT OR IS_WEBENGINE)
- copy("${PROJECT_SOURCE_DIR}/themes/" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/themes/" prepare-bin)
- endif()
- if(ENABLE_PLUGINS AND EXISTS ${PROJECT_SOURCE_DIR}/skins)
- @@ -446,7 +443,7 @@ if(LINUX)
- set(PROJECT_OUTPUT_DATA_DIR "${DATA_INSTALL_DIR}/${SHARE_SUFF}")
- install(FILES ${PROJECT_SOURCE_DIR}/client_icons.txt DESTINATION ${PROJECT_OUTPUT_DATA_DIR})
- install(DIRECTORY ${OTHER_FILES} DESTINATION ${PROJECT_OUTPUT_DATA_DIR})
- - if(ENABLE_WEBKIT)
- + if(IS_WEBKIT OR IS_WEBENGINE)
- install(DIRECTORY ${PROJECT_SOURCE_DIR}/themes DESTINATION ${PROJECT_OUTPUT_DATA_DIR})
- endif()
- if(LANGS_EXISTS)
- @@ -482,7 +479,7 @@ if(HAIKU)
- install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_PREFIX})
- install(FILES ${PROJECT_SOURCE_DIR}/client_icons.txt DESTINATION ${CMAKE_INSTALL_PREFIX}/${SHARE_SUFF})
- install(DIRECTORY ${OTHER_FILES} DESTINATION ${CMAKE_INSTALL_PREFIX}/${SHARE_SUFF})
- - if(ENABLE_WEBKIT)
- + if(IS_WEBKIT OR IS_WEBENGINE)
- install(DIRECTORY ${PROJECT_SOURCE_DIR}/themes DESTINATION ${CMAKE_INSTALL_PREFIX}/${SHARE_SUFF})
- endif()
- if(LANGS_EXISTS)
- @@ -495,7 +492,7 @@ if(WIN32)
- if(NOT ONLY_BINARY AND INSTALL_EXTRA_FILES)
- install(FILES ${PROJECT_SOURCE_DIR}/client_icons.txt DESTINATION ${CMAKE_INSTALL_PREFIX})
- install(DIRECTORY ${OTHER_FILES} DESTINATION ${CMAKE_INSTALL_PREFIX})
- - if(ENABLE_WEBKIT)
- + if(IS_WEBKIT OR IS_WEBENGINE)
- install(DIRECTORY ${PROJECT_SOURCE_DIR}/themes DESTINATION ${CMAKE_INSTALL_PREFIX})
- endif()
- if(LANGS_EXISTS)
- @@ -528,7 +525,7 @@ if(APPLE)
- # end of qca hack
- # Special hack for QtWebEngineProcess executable from Homebrew
- - if(USE_WEBENGINE AND HOMEBREW)
- + if(IS_WEBENGINE AND HOMEBREW)
- set(QtWebEngineProcess_path "Versions/5/Helpers/QtWebEngineProcess.app")
- set(QtWebEngineProcess_file "${QtWebEngineProcess_path}/Contents/MacOS/QtWebEngineProcess")
- set(QtWebEngineCore_path "${CLIENT_NAME}.app/Contents/Frameworks/QtWebEngineCore.framework")
- @@ -565,7 +562,7 @@ if(APPLE)
- install(FILES ${MACOSX_ICON} DESTINATION "${PROJECT_OUTPUT_DATA_DIR}")
- install(FILES ${PROJECT_SOURCE_DIR}/client_icons.txt DESTINATION "${PROJECT_OUTPUT_DATA_DIR}")
- install(DIRECTORY ${OTHER_FILES} DESTINATION "${PROJECT_OUTPUT_DATA_DIR}")
- - if(ENABLE_WEBKIT)
- + if(IS_WEBKIT OR IS_WEBENGINE)
- install(DIRECTORY ${PROJECT_SOURCE_DIR}/themes DESTINATION "${PROJECT_OUTPUT_DATA_DIR}")
- endif()
- if(LANGS_EXISTS)
- diff --git a/src/src.cmake b/src/src.cmake
- index 58c31e24..4addf349 100644
- --- a/src/src.cmake
- +++ b/src/src.cmake
- @@ -470,8 +470,8 @@ list(APPEND SOURCES
- historyimp.cpp
- )
- -if(ENABLE_WEBKIT)
- - if(USE_WEBENGINE)
- +if(IS_WEBKIT OR IS_WEBENGINE)
- + if(IS_WEBENGINE)
- list(APPEND SOURCES
- themeserver.cpp
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement