calamares/lang/CMakeLists.txt
Adriaan de Groot 3173a8ee3c i18n: expand helper function to handle more cases
- move template QRC file to the module that defines the function
- add parameters to accept more files (prefixes) per language
2023-09-04 23:26:43 +02:00

39 lines
1.0 KiB
CMake

# === This file is part of Calamares - <https://calamares.io> ===
#
# SPDX-FileCopyrightText: 2018 Adriaan de Groot <groot@kde.org>
# SPDX-License-Identifier: BSD-2-Clause
#
###
#
# This CMakeList handles the following i18n / language targets:
#
# - creating a translation test-tool
# - building the Python (gettext-based) translations
# - compiling all the Qt translations into a C++ file calamares-i18n.cxx
# - defines an OBJECT LIBRARY calamares-i18n for linking the compiled
# translations into an executable.
include(CalamaresAddTranslations)
find_package(${qtname} COMPONENTS Xml)
if(TARGET ${qtname}::Xml)
add_executable(txload txload.cpp)
target_link_libraries(txload ${qtname}::Xml)
endif()
install_calamares_gettext_translations(python
SOURCE_DIR ${CMAKE_SOURCE_DIR}/lang/python
FILENAME python.mo
RENAME calamares-python.mo
)
### TRANSLATIONS
#
#
calamares_qrc_translations(calamares-i18n
OUTPUT_VARIABLE translation_outfile
PREFIXES calamares tz kb
)
add_library(calamares-i18n OBJECT ${translation_outfile})