2020-08-25 16:05:56 +02:00
|
|
|
# === This file is part of Calamares - <https://calamares.io> ===
|
2020-08-26 00:24:52 +02:00
|
|
|
#
|
|
|
|
# SPDX-FileCopyrightText: 2020 Adriaan de Groot <groot@kde.org>
|
|
|
|
# SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
#
|
2021-07-26 14:55:12 +02:00
|
|
|
set( CALA_WEBVIEW_LINK_LIBRARIES "" )
|
2016-03-29 10:22:58 +02:00
|
|
|
|
2016-04-22 15:56:37 +02:00
|
|
|
option( WEBVIEW_FORCE_WEBKIT "Always build webview with WebKit instead of WebEngine regardless of Qt version." OFF)
|
2016-03-29 10:22:58 +02:00
|
|
|
|
2019-04-30 13:12:16 +02:00
|
|
|
set( _reason "" )
|
|
|
|
|
2017-07-25 09:44:34 +02:00
|
|
|
message( STATUS "Found Qt version ${Qt5Core_VERSION}")
|
2016-04-22 15:56:37 +02:00
|
|
|
if ( Qt5Core_VERSION VERSION_LESS 5.6 OR WEBVIEW_FORCE_WEBKIT )
|
2017-07-25 09:44:34 +02:00
|
|
|
message( STATUS " .. using webkit")
|
2019-04-30 13:12:16 +02:00
|
|
|
find_package( Qt5 ${QT_VERSION} CONFIG COMPONENTS WebKit WebKitWidgets )
|
|
|
|
|
|
|
|
if ( Qt5WebKit_FOUND AND Qt5WebKitWidgets_FOUND )
|
|
|
|
list( APPEND CALA_WEBVIEW_INCLUDE_DIRECTORIES
|
|
|
|
${QT_QTWEBKIT_INCLUDE_DIR}
|
|
|
|
)
|
|
|
|
list( APPEND CALA_WEBVIEW_LINK_LIBRARIES
|
|
|
|
Qt5::WebKit
|
|
|
|
Qt5::WebKitWidgets
|
|
|
|
)
|
|
|
|
set( WEBVIEW_WITH_WEBKIT 1 )
|
|
|
|
else()
|
|
|
|
set( _reason "No suitable WebKit" )
|
|
|
|
endif()
|
2016-03-29 10:22:58 +02:00
|
|
|
else()
|
2017-07-25 09:44:34 +02:00
|
|
|
message( STATUS " .. using webengine")
|
2019-04-30 13:12:16 +02:00
|
|
|
find_package( Qt5 ${QT_VERSION} CONFIG COMPONENTS WebEngine WebEngineWidgets )
|
|
|
|
|
|
|
|
if ( Qt5WebEngine_FOUND AND Qt5WebEngineWidgets_FOUND )
|
|
|
|
list( APPEND CALA_WEBVIEW_INCLUDE_DIRECTORIES
|
|
|
|
${QT_QTWEBENGINE_INCLUDE_DIR}
|
|
|
|
)
|
|
|
|
list( APPEND CALA_WEBVIEW_LINK_LIBRARIES
|
|
|
|
Qt5::WebEngine
|
|
|
|
Qt5::WebEngineWidgets
|
|
|
|
)
|
|
|
|
set( WEBVIEW_WITH_WEBENGINE 1 )
|
|
|
|
else()
|
|
|
|
set( _reason "No suitable WebEngine" )
|
|
|
|
endif()
|
2016-03-29 10:22:58 +02:00
|
|
|
endif()
|
2016-03-24 16:53:18 +01:00
|
|
|
|
2019-04-30 13:12:16 +02:00
|
|
|
if ( NOT _reason )
|
|
|
|
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/WebViewConfig.h.in
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/WebViewConfig.h )
|
2015-08-14 17:18:17 +02:00
|
|
|
|
2019-04-30 13:12:16 +02:00
|
|
|
calamares_add_plugin( webview
|
|
|
|
TYPE viewmodule
|
|
|
|
EXPORT_MACRO PLUGINDLLEXPORT_PRO
|
|
|
|
SOURCES
|
|
|
|
WebViewStep.cpp
|
|
|
|
LINK_PRIVATE_LIBRARIES
|
|
|
|
${CALA_WEBVIEW_LINK_LIBRARIES}
|
|
|
|
SHARED_LIB
|
|
|
|
)
|
|
|
|
else()
|
|
|
|
calamares_skip_module( "webview (${_reason})" )
|
|
|
|
endif()
|