2 file(STRINGS LINGUAS linguas)
4 # The default build target (ALL) only creates .gmo files from .po files.
5 foreach(lang ${linguas})
6 gettext_process_po_files(${lang} ALL PO_FILES ${lang}.po)
8 # Use custom install target instead of specifying the INSTALL_DESTINATION
9 # option for gettext_process_po_files() because it gets naming of the
10 # resulting .mo files wrong.
11 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${lang}.gmo
12 DESTINATION "share/locale/${lang}/LC_MESSAGES/" RENAME ${PROJECT_NAME}.mo)
15 # Note: CMake currently (version 3.3) does not have any built-in support for
16 # generating .pot files. Additionally, the way FindGettext works does not
17 # allow to create targets for generating .po files because both
18 # gettext_create_translations() and gettext_process_pot_file() always do
19 # msgmerge+msgfmt and the msgfmt command creates a clashing rule with the one
20 # produced by gettext_process_po_files().
22 # This means update-po functionality provided by the autotools build is not
23 # currently available in the CMake build.