From 4ceceea94a37abf29ba31c7faa806b838b167c0a Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Fri, 15 Dec 2023 09:29:23 +1000 Subject: [PATCH] Add WITH_QTWEBENGINE cmake flag Logic is: - Cannot be enabled if webkit support is enabled (to simplify logic in QGIS classes - if webkit is enabled, then webkit widgets will be used. if webengine is enabled, then webengine widgets will be used) - Cannot be enabled if QGIS 3D support is enabled (due to incompatibility between webengine and Qt3D framework) --- CMakeLists.txt | 16 ++++++++++++++++ cmake_templates/qgsconfig.h.in | 2 ++ 2 files changed, 18 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index e72bbe41236..5de465bde66 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -510,6 +510,22 @@ if(WITH_CORE) set(HAVE_3D TRUE) # used in qgsconfig.h endif() + set (WITH_QTWEBENGINE FALSE CACHE BOOL "Enable QtWebEngine support") + if (WITH_QTWEBENGINE) + if(WITH_3D) + message(FATAL_ERROR "QtWebEngine support cannot be enabled if QGIS 3D support is enabled") + endif() + if(WITH_QTWEBKIT) + message(FATAL_ERROR "QtWebEngine support cannot be enabled if Qt WebKit support is enabled") + endif() + add_definitions(-DWITH_QTWEBENGINE) + message(STATUS "QtWebEngine support enabled") + set(HAVE_WEBENGINE TRUE) # used in qgsconfig.h + else() + message(STATUS "QtWebEngine support DISABLED.") + set(HAVE_WEBENGINE FALSE) # used in qgsconfig.h + endif() + # get the Qt plugins directory get_target_property(QMAKE_EXECUTABLE ${QT_VERSION_BASE}::qmake LOCATION) diff --git a/cmake_templates/qgsconfig.h.in b/cmake_templates/qgsconfig.h.in index 800e65d3cfd..0a8742f2b61 100644 --- a/cmake_templates/qgsconfig.h.in +++ b/cmake_templates/qgsconfig.h.in @@ -122,5 +122,7 @@ #cmakedefine HAVE_CRASH_HANDLER +#cmakedefine HAVE_WEBENGINE + #endif