Debian Codegraph @

tests/auto/cmake/linguist/test_i18n_exclusion/CMakeLists.txt

raw
1 # Copyright (C) 2023 The Qt Company Ltd.
2 # SPDX-License-Identifier: BSD-3-Clause
3
4 cmake_minimum_required(VERSION 3.16)
5 project(test_i18n_exclusion)
6
7 # Set up the project structure.
8 find_package(Qt6 REQUIRED COMPONENTS Core Gui LinguistTools)
9 qt_standard_project_setup()
10 add_subdirectory(libs)
11 add_subdirectory(apps)
12 add_subdirectory(tests)
13
14 # Generate a fresh, empty .ts file in the build directory.
15 set(ts_file "${CMAKE_CURRENT_BINARY_DIR}/test_i18n_exclusion_de.ts")
16 configure_file(test_i18n_exclusion_de.ts.in "${ts_file}")
17
18 # Set up the 'update_translations' target.
19 qt_collect_translation_source_targets(i18n_targets)
20 qt_add_lupdate(
21 SOURCE_TARGETS ${i18n_targets}
22 TS_FILES "${ts_file}"
23 )
24
25 # Build the 'update_translations' target by default and check the content of the updated .ts file.
26 add_custom_target(force_ts_update ALL
27 COMMAND "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_SOURCE_DIR}/check_ts_file.cmake"
28 )
29 add_dependencies(force_ts_update update_translations)