File 0001-build-system-allow-adaptive-building-without-WebKit.patch of Package Subsurface
From 68c72827a9b61382a9e3c5a5fe5f88477aefe054 Mon Sep 17 00:00:00 2001
From: Dirk Hohndel <dirk@hohndel.org>
Date: Wed, 6 Jul 2022 13:11:38 -0700
Subject: [PATCH] build-system: allow adaptive building without WebKit
This should avoid build failures on platforms where we don't know if
QtWebKit will be available or not.
The options for printing and user manual are awkward to work with. This
all needs to be cleaned up at some point. Right.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
---
CMakeLists.txt | 27 +++++++++++++++++++++------
cmake/Modules/HandleUserManual.cmake | 6 ------
2 files changed, 21 insertions(+), 12 deletions(-)
delete mode 100644 cmake/Modules/HandleUserManual.cmake
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f7146878d334..737adc62bc49 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -141,9 +141,6 @@ include(pkgconfig_helper)
# module file.
include(HandleFindGit2)
include(HandleFindLibDiveComputer)
-if (SUBSURFACE_TARGET_EXECUTABLE MATCHES "DesktopExecutable")
- include(HandleUserManual)
-endif()
include(HandleFtdiSupport)
include(HandleVersionGeneration)
include(RunOnBuildDir)
@@ -216,14 +213,32 @@ if (SUBSURFACE_TARGET_EXECUTABLE MATCHES "DesktopExecutable")
endif()
list(APPEND QT_EXTRA_COMPONENTS QuickWidgets)
remove_definitions(-DSUBSURFACE_MOBILE)
+ if(NO_USERMANUAL)
+ message(STATUS "building without built-in user manual support")
+ add_definitions(-DNO_USERMANUAL)
+ else()
+ set(REQUEST_WEBKIT ON)
+ endif()
if(NO_PRINTING)
message(STATUS "building without printing support")
add_definitions(-DNO_PRINTING)
else()
- LIST(APPEND QT_EXTRA_COMPONENTS PrintSupport)
+ set(REQUEST_WEBKIT ON)
+ endif()
+ if(REQUEST_WEBKIT)
# Because Qt5WebKitWidgets isn't a part of the "regular" Qt5, we can't get it the normal way
- find_package(Qt5WebKitWidgets REQUIRED)
- set(SUBSURFACE_LINK_LIBRARIES ${SUBSURFACE_LINK_LIBRARIES} Qt5::WebKitWidgets)
+ find_package(Qt5WebKitWidgets QUIET)
+ if(Qt5WebKitWidgets_FOUND STREQUAL "1")
+ LIST(APPEND QT_EXTRA_COMPONENTS PrintSupport WebKitWidgets)
+ LIST(APPEND SUBSURFACE_LINK_LIBRARIES Qt5::WebKitWidgets)
+ message(STATUS "building with QtWebKit")
+ else()
+ message(STATUS "didn't find QtWebKit, building without user manual and printing support")
+ add_definitions(-DNO_PRINTING)
+ add_definitions(-DNO_USERMANUAL)
+ set(NO_PRINTING ON)
+ set(NO_USERMANUAL ON)
+ endif()
endif()
elseif (SUBSURFACE_TARGET_EXECUTABLE MATCHES "MobileExecutable")
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
diff --git a/cmake/Modules/HandleUserManual.cmake b/cmake/Modules/HandleUserManual.cmake
deleted file mode 100644
index 226b8ca9e0c5..000000000000
--- a/cmake/Modules/HandleUserManual.cmake
+++ /dev/null
@@ -1,6 +0,0 @@
-if(NO_USERMANUAL)
- message(STATUS "building without usermanual")
- add_definitions(-DNO_USERMANUAL)
-else()
- list(APPEND QT_EXTRA_COMPONENTS WebKitWidgets)
-endif()
--
2.35.3