diff options
author | Michal Klocek <michal.klocek@qt.io> | 2021-08-21 13:45:56 +0200 |
---|---|---|
committer | Michal Klocek <michal.klocek@qt.io> | 2021-08-29 15:54:33 +0200 |
commit | b4915805b9527864e2475acfb29f7a029f3325ca (patch) | |
tree | 05bf237b8fb586cbd5f8792e18874e13e048d495 /examples/webenginewidgets | |
parent | bd75c51f2a7f7384d3303e86764211cb3e32f03d (diff) |
Fix issue of not working dictionary conversion
Test and examples are no longer included as external
projects, this created and issue that convert_dict
tool does not work during build time due to not installed
resources. Before we supported converting dictionaries
in a prefix build, by supplying the path to the ICU data
file located in the Qt build path. The tool had wrapper script
generated which set QT_WEBENGINE_ICU_DATA_DIR.
This was done using QT_TOOL_ENV:
icu_data_dir.name = QT_WEBENGINE_ICU_DATA_DIR
icu_data_dir.value = $$OUT_PWD/../../../src/core/$$getConfigDir()
QT_TOOL_ENV = icu_data_dir
load(qt_tool)
Add workaround for that issue with cmake by setting env variable
with relative path to resources in build tree.
Make example more exciting for new comers and add generator
expression which guards the setting based on module build.
Note this is temporary solution and webengine cmake api should be
introduced to wrap the conversion tasks in some nice look public api
based on qt_internal_wrap_tool_command.
Disable example on windows, since on one of coin winodws machines we get
error "Exit code 0xc0000135".
Task-number: QTBUG-95590
Pick-to: 6.2
Change-Id: I44664cbcc85b00ec66657e583929a0fba7bde65b
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'examples/webenginewidgets')
-rw-r--r-- | examples/webenginewidgets/CMakeLists.txt | 3 | ||||
-rw-r--r-- | examples/webenginewidgets/spellchecker/CMakeLists.txt | 10 |
2 files changed, 9 insertions, 4 deletions
diff --git a/examples/webenginewidgets/CMakeLists.txt b/examples/webenginewidgets/CMakeLists.txt index 651a01344..a0dc6330d 100644 --- a/examples/webenginewidgets/CMakeLists.txt +++ b/examples/webenginewidgets/CMakeLists.txt @@ -16,6 +16,7 @@ if(QT_FEATURE_webengine_printing_and_pdf) add_subdirectory(printme) add_subdirectory(html2pdf) endif() -if(QT_FEATURE_webengine_spellchecker AND NOT CMAKE_CROSSCOMPILING AND NOT QT_FEATURE_webengine_native_spellchecker) +if(QT_FEATURE_webengine_spellchecker AND NOT CMAKE_CROSSCOMPILING + AND NOT QT_FEATURE_webengine_native_spellchecker AND NOT WIN32) add_subdirectory(spellchecker) endif() diff --git a/examples/webenginewidgets/spellchecker/CMakeLists.txt b/examples/webenginewidgets/spellchecker/CMakeLists.txt index f05cd74fe..5cec0087d 100644 --- a/examples/webenginewidgets/spellchecker/CMakeLists.txt +++ b/examples/webenginewidgets/spellchecker/CMakeLists.txt @@ -65,14 +65,18 @@ else() set(spellcheckerDir ${CMAKE_CURRENT_BINARY_DIR}/qtwebengine_dictionaries) endif() +# note setting QT_WEBENGINE_ICU_DATA below is not required if this example +# is not compiled as part of qtwebengine module build + foreach(dictFile ${dicts}) get_filename_component(dictName ${dictFile} NAME_WE) add_custom_command(TARGET spellchecker PRE_BUILD COMMAND ${CMAKE_COMMAND} -E make_directory ${spellcheckerDir} - COMMAND $<TARGET_FILE:${QT_CMAKE_EXPORT_NAMESPACE}::qwebengine_convert_dict> - ${CMAKE_CURRENT_SOURCE_DIR}/dict/${dictFile} - ${spellcheckerDir}/${dictName}.bdic + COMMAND ${CMAKE_COMMAND} -E env + $<IF:$<BOOL:${WEBENGINE_MODULE_BUILD}>,QT_WEBENGINE_ICU_DATA_DIR=${CMAKE_CURRENT_BINARY_DIR}/../../../resources,CMAKE=AWESOME> + $<TARGET_FILE:${QT_CMAKE_EXPORT_NAMESPACE}::qwebengine_convert_dict> + ${CMAKE_CURRENT_SOURCE_DIR}/dict/${dictFile} ${spellcheckerDir}/${dictName}.bdic COMMENT "Running qwebengine_convert_dict" ) endforeach() |