diff options
author | Antenore Gatta <antenore@simbiosi.org> | 2018-07-27 01:02:59 +0300 |
---|---|---|
committer | Antenore Gatta <antenore@simbiosi.org> | 2018-07-27 01:02:59 +0300 |
commit | 5e5e4773ac55a9db419b04ef9fa1a5ceaa0c09a0 (patch) | |
tree | 431532fedffa6bca6a6a91635ba5c3be9332a997 /cmake/GETTEXT.cmake | |
parent | 5a6569b33f4866d53838884eb028dd282ed6e125 (diff) |
Translations improvements
Diffstat (limited to 'cmake/GETTEXT.cmake')
-rw-r--r-- | cmake/GETTEXT.cmake | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/cmake/GETTEXT.cmake b/cmake/GETTEXT.cmake index 368a6bec6..3d9d4bdd6 100644 --- a/cmake/GETTEXT.cmake +++ b/cmake/GETTEXT.cmake @@ -20,17 +20,17 @@ find_suggested_package(Gettext) function(gettext po_dir package_name) - set(mo_files) - file(GLOB po_files ${po_dir}/*.po) - foreach(po_file ${po_files}) - get_filename_component(lang ${po_file} NAME_WE) - if(("$ENV{LINGUAS}" MATCHES "(^| )${lang}( |$)") OR (NOT DEFINED ENV{LINGUAS})) - set(mo_file ${CMAKE_CURRENT_BINARY_DIR}/${lang}.mo) - add_custom_command(OUTPUT ${mo_file} COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${mo_file} ${po_file} DEPENDS ${po_file}) - install(FILES ${mo_file} DESTINATION ${CMAKE_INSTALL_LOCALEDIR}/${lang}/LC_MESSAGES RENAME ${package_name}.mo) - set(mo_files ${mo_files} ${mo_file}) - endif() - endforeach() - set(translations-target "${package_name}-translations") - add_custom_target(${translations-target} ALL DEPENDS ${mo_files}) + set(mo_files) + file(GLOB po_files ${po_dir}/*.po) + foreach(po_file ${po_files}) + get_filename_component(lang ${po_file} NAME_WE) + if(("$ENV{LINGUAS}" MATCHES "(^| )${lang}( |$)") OR (NOT DEFINED ENV{LINGUAS})) + set(mo_file ${CMAKE_CURRENT_BINARY_DIR}/${lang}.mo) + add_custom_command(OUTPUT ${mo_file} COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${mo_file} ${po_file} DEPENDS ${po_file}) + install(FILES ${mo_file} DESTINATION ${CMAKE_INSTALL_LOCALEDIR}/${lang}/LC_MESSAGES RENAME ${package_name}.mo) + set(mo_files ${mo_files} ${mo_file}) + endif() + endforeach() + set(translations-target "${package_name}-translations") + add_custom_target(${translations-target} ALL DEPENDS ${mo_files}) endfunction() |