2021-10-19 00:39:07 +08:00
|
|
|
set(languages de en fr pl pt_BR sv zh_CN)
|
2017-11-16 21:33:35 +08:00
|
|
|
|
2020-03-15 07:11:35 +08:00
|
|
|
include(FeatureSummary)
|
2017-11-16 21:33:35 +08:00
|
|
|
|
2020-03-15 07:11:35 +08:00
|
|
|
option(WITH_GETTEXT "translate messages if gettext is available" ON)
|
|
|
|
if(WITH_GETTEXT)
|
|
|
|
find_package(Gettext)
|
|
|
|
endif()
|
|
|
|
add_feature_info(gettext GETTEXT_FOUND "translate messages with gettext")
|
2017-11-16 21:33:35 +08:00
|
|
|
|
|
|
|
# Define translations
|
2020-03-15 07:11:35 +08:00
|
|
|
if(GETTEXT_FOUND)
|
2021-03-22 04:29:41 +08:00
|
|
|
# Group pofile targets into their own folder, as there's a lot of them.
|
|
|
|
set(CMAKE_FOLDER pofiles)
|
2020-03-15 07:11:35 +08:00
|
|
|
foreach(lang ${languages})
|
2018-01-22 14:30:36 +08:00
|
|
|
# Our translations aren't set up entirely as CMake expects, so installation is done in
|
|
|
|
# cmake/Install.cmake instead of using INSTALL_DESTINATION
|
2020-03-15 07:11:35 +08:00
|
|
|
gettext_process_po_files(${lang} ALL
|
2017-11-16 21:33:35 +08:00
|
|
|
PO_FILES po/${lang}.po)
|
2020-03-15 07:11:35 +08:00
|
|
|
endforeach()
|
2021-03-22 04:29:41 +08:00
|
|
|
set(CMAKE_FOLDER)
|
2020-03-15 07:11:35 +08:00
|
|
|
endif()
|