03c5e366ed
Introduce some Calamares helpers in the compat/ headers space to help Xml-wrangling (i18n support tools, GeoIP) avoid compiler warnings about deprecated API. It's cleaner this way anyway, with a nice value returned from setting a document's contents, rather than a bunch of pointer arguments.
43 lines
1.3 KiB
CMake
43 lines
1.3 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)
|
|
# 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()
|
|
|
|
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)
|