aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Tari <robert@tari.in>2021-10-20 20:24:03 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2021-10-21 11:21:58 +0200
commite671e0e4a44ec796a3be4496bbab1a603f9bd11b (patch)
tree0131aaef5df86dabcd845271e9b24bdc11b679c2
parent590f9614f0d9a48026dd9618bf6213b16968be1a (diff)
downloadayatana-indicator-session-e671e0e4a44ec796a3be4496bbab1a603f9bd11b.tar.gz
ayatana-indicator-session-e671e0e4a44ec796a3be4496bbab1a603f9bd11b.tar.bz2
ayatana-indicator-session-e671e0e4a44ec796a3be4496bbab1a603f9bd11b.zip
Use native CMake Intltool module
cmake/Translations.cmake: Drop file po/CMakeLists.txt: Use Intltool
-rw-r--r--cmake/Translations.cmake37
-rw-r--r--po/CMakeLists.txt9
2 files changed, 6 insertions, 40 deletions
diff --git a/cmake/Translations.cmake b/cmake/Translations.cmake
deleted file mode 100644
index b51c39d..0000000
--- a/cmake/Translations.cmake
+++ /dev/null
@@ -1,37 +0,0 @@
-# Translations.cmake, CMake macros written for Marlin, feel free to re-use them
-
-macro(add_translations_directory NLS_PACKAGE)
- add_custom_target (i18n ALL)
- find_program (MSGFMT_EXECUTABLE msgfmt)
- file (GLOB PO_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.po)
- foreach (PO_INPUT ${PO_FILES})
- get_filename_component (PO_INPUT_BASE ${PO_INPUT} NAME_WE)
- set (MO_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${PO_INPUT_BASE}.mo)
- add_custom_command (TARGET i18n COMMAND ${MSGFMT_EXECUTABLE} -o ${MO_OUTPUT} ${PO_INPUT})
-
- install (FILES ${MO_OUTPUT} DESTINATION
- ${CMAKE_INSTALL_LOCALEDIR}/${PO_INPUT_BASE}/LC_MESSAGES
- RENAME ${NLS_PACKAGE}.mo)
- endforeach (PO_INPUT ${PO_FILES})
-endmacro(add_translations_directory)
-
-
-macro(add_translations_catalog NLS_PACKAGE)
- add_custom_target (pot COMMENT “Building translation catalog.”)
- find_program (XGETTEXT_EXECUTABLE xgettext)
-
- # init this list, which will hold all the sources across all dirs
- set(SOURCES "")
-
- # add each directory's sources to the overall sources list
- foreach(FILES_INPUT ${ARGN})
- set (DIR ${CMAKE_CURRENT_SOURCE_DIR}/${FILES_INPUT})
- file (GLOB_RECURSE DIR_SOURCES ${DIR}/*.c ${DIR}/*.cc ${DIR}/*.cpp ${DIR}/*.cxx ${DIR}/*.vala)
- set (SOURCES ${SOURCES} ${DIR_SOURCES})
- endforeach()
-
- add_custom_command (TARGET pot COMMAND
- ${XGETTEXT_EXECUTABLE} -d ${NLS_PACKAGE} -o ${CMAKE_CURRENT_SOURCE_DIR}/${NLS_PACKAGE}.pot
- ${SOURCES} --keyword="_" --keyword="N_" --from-code=UTF-8
- )
-endmacro()
diff --git a/po/CMakeLists.txt b/po/CMakeLists.txt
index c47d584..0b2b2a1 100644
--- a/po/CMakeLists.txt
+++ b/po/CMakeLists.txt
@@ -1,3 +1,6 @@
-include (Translations)
-add_translations_directory ("${GETTEXT_PACKAGE}")
-add_translations_catalog ("${GETTEXT_PACKAGE}" ../src/ ../src/dbus-backend)
+find_package(Intltool REQUIRED)
+
+intltool_install_translations(
+ ALL
+ GETTEXT_PACKAGE ${GETTEXT_PACKAGE}
+)