From 3a2dd40b179405da84c85d5877a6e2678b36ce8a Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Mon, 25 Oct 2021 13:23:44 +0200 Subject: Add cmake api for 'bdict' dictionary conversion MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Michael BrĂ¼ning --- tests/auto/widgets/spellchecking/CMakeLists.txt | 31 ++++--------------------- 1 file changed, 5 insertions(+), 26 deletions(-) (limited to 'tests/auto/widgets') 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 - $ - ${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 $ 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}/$ - ) -endif() -- cgit v1.2.3