summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/spellchecking/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/widgets/spellchecking/CMakeLists.txt')
-rw-r--r--tests/auto/widgets/spellchecking/CMakeLists.txt34
1 files changed, 9 insertions, 25 deletions
diff --git a/tests/auto/widgets/spellchecking/CMakeLists.txt b/tests/auto/widgets/spellchecking/CMakeLists.txt
index afed7e28b..d0c7656c1 100644
--- a/tests/auto/widgets/spellchecking/CMakeLists.txt
+++ b/tests/auto/widgets/spellchecking/CMakeLists.txt
@@ -1,4 +1,8 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
include(../../util/util.cmake)
+include(../../../../src/core/api/Qt6WebEngineCoreMacros.cmake)
qt_internal_add_test(tst_spellchecking
SOURCES
@@ -16,34 +20,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 $<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()