mirror of
https://github.com/savoirfairelinux/jami-client-qt.git
synced 2026-01-05 03:42:52 +08:00
build: add option to build without Qt WebEngine
This patch allows building the project without Qt WebEngine, by disabling (for the time being) the features that depend on it: the emoji picker, link previews, and media file previews in the chatview. Co-authored-by: Andreas Traczyk <andreas.traczyk@savoirfairelinux.com> Co-authored-by: Amin Bandali <amin.bandali@savoirfairelinux.com> Change-Id: I74751b0cc6f22c61a6fd7281ca3207e0fdbb2212
This commit is contained in:
@@ -42,12 +42,22 @@ set(QT_MODULES
|
||||
Concurrent
|
||||
Core
|
||||
Core5Compat
|
||||
WebEngineCore
|
||||
WebEngineQuick
|
||||
WebChannel
|
||||
WebEngineWidgets
|
||||
Multimedia
|
||||
)
|
||||
|
||||
if(NOT DEFINED WITH_WEBENGINE)
|
||||
set(WITH_WEBENGINE true)
|
||||
endif()
|
||||
|
||||
if(WITH_WEBENGINE)
|
||||
list(APPEND QT_MODULES
|
||||
WebEngineCore
|
||||
WebEngineQuick
|
||||
WebChannel
|
||||
WebEngineWidgets
|
||||
)
|
||||
endif()
|
||||
|
||||
find_package(Qt6 COMPONENTS ${QT_MODULES} REQUIRED)
|
||||
foreach(MODULE ${QT_MODULES})
|
||||
list(APPEND QT_LIBS "Qt::${MODULE}")
|
||||
@@ -57,8 +67,23 @@ set(SRC_DIR ${PROJECT_SOURCE_DIR}/src)
|
||||
set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS})
|
||||
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH true)
|
||||
|
||||
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.12.0")
|
||||
include(FindPython3)
|
||||
find_package (Python3 COMPONENTS Interpreter)
|
||||
set(PYTHON_EXEC ${Python3_EXECUTABLE})
|
||||
else()
|
||||
include(FindPythonInterp)
|
||||
set(PYTHON_EXEC ${PYTHON_EXECUTABLE})
|
||||
endif()
|
||||
|
||||
set(QML_RESOURCES ${PROJECT_SOURCE_DIR}/resources.qrc)
|
||||
set(QML_RESOURCES_QML ${PROJECT_SOURCE_DIR}/qml.qrc)
|
||||
if(WITH_WEBENGINE)
|
||||
set(QML_RESOURCES_QML ${PROJECT_SOURCE_DIR}/qml.qrc)
|
||||
else()
|
||||
execute_process(COMMAND ${PYTHON_EXEC} ${CMAKE_CURRENT_SOURCE_DIR}/scripts/gen-qrc-without-webengine.py
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
set(QML_RESOURCES_QML ${PROJECT_SOURCE_DIR}/qml_without_webengine.qrc)
|
||||
endif()
|
||||
|
||||
if (APPLE)
|
||||
include(FetchContent)
|
||||
@@ -78,14 +103,6 @@ file(GLOB_RECURSE
|
||||
RES_FILES CONFIGURE_DEPENDS
|
||||
${PROJECT_SOURCE_DIR}/resources/*
|
||||
)
|
||||
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.12.0")
|
||||
include(FindPython3)
|
||||
find_package (Python3 COMPONENTS Interpreter)
|
||||
set(PYTHON_EXEC ${Python3_EXECUTABLE})
|
||||
else()
|
||||
include(FindPythonInterp)
|
||||
set(PYTHON_EXEC ${PYTHON_EXECUTABLE})
|
||||
endif()
|
||||
execute_process(
|
||||
COMMAND ${PYTHON_EXEC} ${PROJECT_SOURCE_DIR}/gen-resources.py
|
||||
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
|
||||
@@ -137,7 +154,6 @@ set(COMMON_SOURCES
|
||||
${SRC_DIR}/currentconversation.cpp
|
||||
${SRC_DIR}/currentaccount.cpp
|
||||
${SRC_DIR}/videodevices.cpp
|
||||
${SRC_DIR}/previewengine.cpp
|
||||
${SRC_DIR}/videoprovider.cpp
|
||||
${SRC_DIR}/callparticipantsmodel.cpp
|
||||
)
|
||||
@@ -194,11 +210,19 @@ set(COMMON_HEADERS
|
||||
${SRC_DIR}/currentconversation.h
|
||||
${SRC_DIR}/currentaccount.h
|
||||
${SRC_DIR}/videodevices.h
|
||||
${SRC_DIR}/previewengine.h
|
||||
${SRC_DIR}/videoprovider.h
|
||||
${SRC_DIR}/callparticipantsmodel.h
|
||||
)
|
||||
|
||||
if(WITH_WEBENGINE)
|
||||
list(APPEND COMMON_SOURCES
|
||||
${SRC_DIR}/previewengine.cpp)
|
||||
add_definitions(-DWITH_WEBENGINE)
|
||||
else()
|
||||
list(APPEND COMMON_SOURCES
|
||||
${SRC_DIR}/nowebengine/previewengine.cpp)
|
||||
endif()
|
||||
|
||||
# For libavutil/avframe.
|
||||
set(LIBJAMI_CONTRIB_DIR "${PROJECT_SOURCE_DIR}/../daemon/contrib")
|
||||
find_path(AVUTIL_INCLUDE_DIR libavutil/avutil.h
|
||||
|
||||
Reference in New Issue
Block a user