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)
This commit is contained in:
Nyall Dawson 2023-12-15 09:29:23 +10:00
parent 55d0b1cbcb
commit 4ceceea94a
2 changed files with 18 additions and 0 deletions

View File

@ -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)

View File

@ -122,5 +122,7 @@
#cmakedefine HAVE_CRASH_HANDLER
#cmakedefine HAVE_WEBENGINE
#endif