Warning, /network/konqueror/webenginepart/src/CMakeLists.txt is written in an unsupported language. File is not indexed.
0001 find_package(KF${KF_MAJOR_VERSION} ${KF_MIN_VERSION} REQUIRED COMPONENTS Wallet) 0002 find_package(KF${KF_MAJOR_VERSION} ${KF_MIN_VERSION} REQUIRED COMPONENTS Notifications ) 0003 find_package(KF${KF_MAJOR_VERSION} ${KF_MIN_VERSION} REQUIRED COMPONENTS Sonnet) 0004 0005 find_package(Hunspell) 0006 0007 add_definitions(-DTRANSLATION_DOMAIN=\"webenginepart\") 0008 0009 if(BUILD_TESTING) 0010 add_definitions(-DBUILD_TESTING) 0011 endif(BUILD_TESTING) 0012 0013 #Before Qt 5.15.5 QtWebEngineView didn't allow opening a remote URL by dropping it 0014 #on the view itself, so WebEngineView needed to handle that itself. 0015 if(KF_MAJOR_VERSION STRLESS "6" AND QtWebEngineWidgets_VERSION VERSION_LESS "5.15.5") 0016 add_definitions(-DREMOTE_DND_NOT_HANDLED_BY_WEBENGINE) 0017 endif() 0018 0019 include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_BINARY_DIR}) 0020 0021 set(kwebenginepartlib_LIB_SRCS 0022 webenginepart.cpp 0023 webenginepart_ext.cpp 0024 webengineview.cpp 0025 webenginepage.cpp 0026 websslinfo.cpp 0027 webhistoryinterface.cpp 0028 webenginepartdownloadmanager.cpp 0029 webenginewallet.cpp 0030 settings/webenginesettings.cpp 0031 settings/webengine_filter.cpp 0032 ui/searchbar.cpp 0033 ui/passwordbar.cpp 0034 ui/featurepermissionbar.cpp 0035 about/konq_aboutpage.cpp 0036 webenginecustomizecacheablefieldsdlg.cpp 0037 webfieldsdataview.cpp 0038 ui/credentialsdetailswidget.cpp 0039 webengineurlrequestinterceptor.cpp 0040 spellcheckermanager.cpp 0041 webenginepartcontrols.cpp 0042 webenginepartcertificateerrordlg.cpp 0043 certificateerrordialogmanager.cpp 0044 navigationrecorder.cpp 0045 choosepagesaveformatdlg.cpp 0046 qtwebengine6compat.h 0047 schemehandlers/execschemehandler.cpp 0048 schemehandlers/errorschemehandler.cpp 0049 schemehandlers/kiohandler.cpp 0050 ) 0051 0052 if (DontUseKCookieJar) 0053 list(APPEND kwebenginepartlib_LIB_SRCS 0054 cookies/webenginepartcookiejar6.cpp 0055 cookies/cookiealertdlg.cpp 0056 ) 0057 ki18n_wrap_ui(kwebenginepartlib_LIB_SRCS cookies/cookiealertdlg.ui) 0058 else() 0059 list(APPEND kwebenginepartlib_LIB_SRCS cookies/webenginepartcookiejar_kio.cpp) 0060 endif() 0061 0062 ki18n_wrap_ui(kwebenginepartlib_LIB_SRCS 0063 webenginecustomizecacheablefieldsdlg.ui 0064 ui/credentialsdetailswidget.ui 0065 webenginepartcertificateerrordlg.ui 0066 choosepagesaveformatdlg.ui 0067 ) 0068 0069 if (QT_MAJOR_VERSION STREQUAL 6) 0070 list(APPEND kwebenginepartlib_LIB_SRCS profile.cpp) 0071 endif() 0072 0073 qt_add_resources(kwebenginepartlib_LIB_SRCS webenginepart.qrc) 0074 0075 qt_wrap_ui(kwebenginepartlib_LIB_SRCS 0076 ui/searchbar.ui 0077 ) 0078 ecm_qt_declare_logging_category(kwebenginepartlib_LIB_SRCS 0079 HEADER webenginepart_debug.h 0080 IDENTIFIER WEBENGINEPART_LOG 0081 CATEGORY_NAME org.kde.webenginepart 0082 ) 0083 add_library(kwebenginepartlib ${kwebenginepartlib_LIB_SRCS}) 0084 0085 generate_export_header(kwebenginepartlib) 0086 0087 target_link_libraries(kwebenginepartlib 0088 PUBLIC 0089 Qt${KF_MAJOR_VERSION}::Core 0090 Qt${KF_MAJOR_VERSION}::DBus 0091 Qt${KF_MAJOR_VERSION}::Gui 0092 Qt${KF_MAJOR_VERSION}::Widgets 0093 Qt${KF_MAJOR_VERSION}::WebEngineWidgets 0094 KF${KF_MAJOR_VERSION}::Parts 0095 KF${KF_MAJOR_VERSION}::Wallet 0096 KF${KF_MAJOR_VERSION}::Notifications 0097 KF${KF_MAJOR_VERSION}::KIOWidgets 0098 KF${KF_MAJOR_VERSION}::TextWidgets 0099 KF${KF_MAJOR_VERSION}::Konq 0100 PRIVATE 0101 KF${KF_MAJOR_VERSION}::I18n 0102 Qt${KF_MAJOR_VERSION}::PrintSupport 0103 KF${KF_MAJOR_VERSION}::SonnetCore 0104 KF${KF_MAJOR_VERSION}::IconThemes #for KIconLoader used by WebEnginePartErrorSchemeHandler 0105 KF${KF_MAJOR_VERSION}::WindowSystem # for KUserTimestamp 0106 KF${KF_MAJOR_VERSION}::SonnetUi 0107 ) 0108 0109 target_include_directories(kwebenginepartlib PUBLIC 0110 "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/>" 0111 ) 0112 set_target_properties(kwebenginepartlib PROPERTIES OUTPUT_NAME kwebenginepart) 0113 0114 install(TARGETS kwebenginepartlib ${KDE_INSTALL_TARGETS_DEFAULT_ARGS}) 0115 0116 0117 add_library(webenginepart MODULE webenginepartfactory.cpp) 0118 0119 target_link_libraries(webenginepart kwebenginepartlib) 0120 0121 install(TARGETS webenginepart DESTINATION ${KDE_INSTALL_PLUGINDIR}/kf${KF_MAJOR_VERSION}/parts) 0122 0123 install(FILES error.html DESTINATION ${KDE_INSTALL_DATADIR}/webenginepart) 0124 0125 install(FILES settings/kconf_update/webenginepart.upd DESTINATION ${KDE_INSTALL_KCONFUPDATEDIR}) 0126 0127 set(USE_SYSTEM_DICTIONARIES 0 CACHE BOOL "Don't build QtWebEngine dictionaries but use the system ones") 0128 if((NOT USE_SYSTEM_DICTIONARIES) AND Hunspell_FOUND) 0129 set(WEBENGINEPART_OWN_DICTIONARY_DIR ${CMAKE_INSTALL_PREFIX}/share/konqueror/webengine_dictionaries CACHE PATH "The directory where dictionary files built for WebEnginePart will be installed") 0130 add_compile_definitions(WEBENGINEPART_OWN_DICTIONARY_DIR="${WEBENGINEPART_OWN_DICTIONARY_DIR}") 0131 0132 if (KF_MAJOR_VERSION STRLESS "6") 0133 set(konqueror_internal_lib_target kdeinit_konqueror) 0134 else() 0135 set(konqueror_internal_lib_target konqueror_internal_lib) 0136 endif() 0137 target_compile_definitions(${konqueror_internal_lib_target} PUBLIC WEBENGINEPART_OWN_DICTIONARY_DIR="${WEBENGINEPART_OWN_DICTIONARY_DIR}") 0138 0139 find_package(WebEngineDictConverter) 0140 #COMPILE HUNSPELL DICTIONARIES AS BDIC FILES 0141 #Qt6 provides a command which automatically builds dictionaries (qt_add_webengine_dictionary, see https://doc.qt.io/qt-6/qt-add-webengine-dictionary.html), 0142 #but I can't find out how to install the dictionaries. For the time being, continue relying on custom code 0143 #TODO KF6: see how to install dictionaries created using qt_add_webengine_dictionary and use it 0144 if (WebEngineDictConverter_FOUND) 0145 #Iterate on all dictionaries 0146 foreach(D ${Hunspell_UNIQUE_DICTIONARIES}) 0147 get_filename_component(base_name ${D} NAME) 0148 #Full name of the file to create 0149 set(BDIC_name ${CMAKE_CURRENT_BINARY_DIR}/${base_name}.bdic) 0150 #Name of the target to create 0151 set(BDIC_target_name ${base_name}.bdic_target) 0152 #Check that both .dic and .aff files exist for the given dictionary, otherwise the conversion tool will fail 0153 if (EXISTS ${D}.dic AND EXISTS ${D}.aff) 0154 add_custom_command( 0155 OUTPUT ${BDIC_name} 0156 COMMAND ${WebEngineDictConverter_EXECUTABLE} ${D} ${BDIC_name} 0157 ) 0158 #Install the bdic file 0159 install(FILES ${BDIC_name} DESTINATION ${WEBENGINEPART_OWN_DICTIONARY_DIR}) 0160 #Create a new target which depends on the file 0161 add_custom_target(${BDIC_target_name} DEPENDS ${BDIC_name}) 0162 #Add the new target as dependency to kwebenginepartlib, otherwise the dictionaries won't be built 0163 add_dependencies(kwebenginepartlib ${BDIC_target_name}) 0164 endif() 0165 endforeach() 0166 endif() 0167 endif() 0168 0169 0170 add_subdirectory(about)