summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/spellchecking
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@qt.io>2021-10-25 13:23:44 +0200
committerMichal Klocek <michal.klocek@qt.io>2021-11-17 20:45:40 +0100
commit3a2dd40b179405da84c85d5877a6e2678b36ce8a (patch)
tree8c881aa86ea6d897b56d03dc12482a1516e8ac0e /tests/auto/widgets/spellchecking
parent23cc5bb2588100c6053d9d11b20778724cdbd6e7 (diff)
Add cmake api for 'bdict' dictionary conversion
Fix spellchecker example and test to use new api. Note we should not use qt6 prefix in cmake api in examples. Change-Id: Ib800bf2b7bd83e10060fa01ccd8d4a262752e09b Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'tests/auto/widgets/spellchecking')
-rw-r--r--tests/auto/widgets/spellchecking/CMakeLists.txt31
1 files changed, 5 insertions, 26 deletions
diff --git a/tests/auto/widgets/spellchecking/CMakeLists.txt b/tests/auto/widgets/spellchecking/CMakeLists.txt
index a0cd4d052..2c1926476 100644
--- a/tests/auto/widgets/spellchecking/CMakeLists.txt
+++ b/tests/auto/widgets/spellchecking/CMakeLists.txt
@@ -16,35 +16,14 @@ qt_internal_add_resource(tst_spellchecking "tst_spellchecking"
)
file(GLOB_RECURSE dicts
- RELATIVE ${CMAKE_CURRENT_LIST_DIR}/dict
+ ABSOLUTE ${CMAKE_CURRENT_LIST_DIR}/dict
*.dic
)
-if(QT_GENERATOR_IS_MULTI_CONFIG)
- set(spellcheckerDir ${CMAKE_CURRENT_BINARY_DIR}/dict/qtwebengine_dictionaries)
-else()
- set(spellcheckerDir ${CMAKE_CURRENT_BINARY_DIR}/qtwebengine_dictionaries)
-endif()
-
foreach(dictFile ${dicts})
- get_filename_component(dictName ${dictFile} NAME_WE)
- add_custom_command(TARGET tst_spellchecking
- PRE_BUILD
- COMMAND ${CMAKE_COMMAND} -E make_directory ${spellcheckerDir}
- COMMAND ${CMAKE_COMMAND} -E env
- $<TARGET_FILE:${QT_CMAKE_EXPORT_NAMESPACE}::qwebengine_convert_dict>
- ${CMAKE_CURRENT_SOURCE_DIR}/dict/${dictFile}
- ${spellcheckerDir}/${dictName}.bdic
- COMMENT "Running qwebengine_convert_dict"
+ qt_add_webengine_dictionary(
+ TARGET tst_spellchecking
+ SOURCE "${dictFile}"
+ OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
endforeach()
-
-# copy dictionaries to $<CONFIG> build dir
-if(QT_GENERATOR_IS_MULTI_CONFIG)
- add_custom_command(TARGET tst_spellchecking
- POST_BUILD
- COMMAND ${CMAKE_COMMAND} -E echo Copying dictionares
- COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_BINARY_DIR}/dict
- ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>
- )
-endif()