calamares/lang/CMakeLists.txt

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

43 lines
1.3 KiB
CMake
Raw Normal View History

# === This file is part of Calamares - <https://calamares.io> ===
2018-05-07 14:41:01 +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
#
###
#
# 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)
find_package(${qtname} COMPONENTS Xml)
if(TARGET ${qtname}::Xml)
add_executable(txload txload.cpp)
target_link_libraries(txload ${qtname}::Xml)
# 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)
endif()
2022-02-08 16:18:47 +01:00
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})
set_property(TARGET calamares-i18n PROPERTY POSITION_INDEPENDENT_CODE ON)