2020-08-25 16:05:56 +02:00
|
|
|
# === This file is part of Calamares - <https://calamares.io> ===
|
2018-05-07 14:41:01 +02:00
|
|
|
#
|
2020-08-26 00:24:52 +02:00
|
|
|
# SPDX-FileCopyrightText: 2018 Adriaan de Groot <groot@kde.org>
|
|
|
|
# SPDX-License-Identifier: BSD-2-Clause
|
2018-05-07 14:41:01 +02:00
|
|
|
#
|
|
|
|
###
|
2021-09-07 16:31:24 +02:00
|
|
|
#
|
|
|
|
# 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.
|
2018-05-07 14:41:01 +02:00
|
|
|
|
2022-02-08 16:18:47 +01:00
|
|
|
include(CalamaresAddTranslations)
|
2020-08-27 13:59:23 +02:00
|
|
|
|
2023-09-03 20:35:57 +02:00
|
|
|
find_package(${qtname} COMPONENTS Xml)
|
|
|
|
if(TARGET ${qtname}::Xml)
|
2018-12-11 13:55:31 +01:00
|
|
|
add_executable(txload txload.cpp)
|
2023-09-03 20:35:57 +02:00
|
|
|
target_link_libraries(txload ${qtname}::Xml)
|
2024-12-02 15:01:31 +01:00
|
|
|
# Special-case, needs compatibility-header for XML-handling,
|
|
|
|
# but doesn't want all of libcalamares.
|
|
|
|
target_include_directories(txload PRIVATE ${CMAKE_SOURCE_DIR}/src/libcalamares)
|
2018-12-11 13:55:31 +01:00
|
|
|
endif()
|
2020-08-27 13:59:23 +02:00
|
|
|
|
2022-02-08 16:18:47 +01:00
|
|
|
install_calamares_gettext_translations(python
|
2020-08-27 13:59:23 +02:00
|
|
|
SOURCE_DIR ${CMAKE_SOURCE_DIR}/lang/python
|
|
|
|
FILENAME python.mo
|
|
|
|
RENAME calamares-python.mo
|
|
|
|
)
|
2021-09-07 16:31:24 +02:00
|
|
|
|
|
|
|
### TRANSLATIONS
|
|
|
|
#
|
|
|
|
#
|
2023-09-04 22:59:33 +02:00
|
|
|
calamares_qrc_translations(calamares-i18n
|
|
|
|
OUTPUT_VARIABLE translation_outfile
|
|
|
|
PREFIXES calamares tz kb
|
2021-09-07 16:31:24 +02:00
|
|
|
)
|
|
|
|
|
2023-09-04 22:59:33 +02:00
|
|
|
add_library(calamares-i18n OBJECT ${translation_outfile})
|
2024-03-10 01:33:52 +01:00
|
|
|
set_property(TARGET calamares-i18n PROPERTY POSITION_INDEPENDENT_CODE ON)
|