diff options
author | Arjen Hiemstra <ahiemstra@heimr.nl> | 2015-09-11 14:52:58 +0300 |
---|---|---|
committer | Arjen Hiemstra <ahiemstra@heimr.nl> | 2015-09-11 15:47:53 +0300 |
commit | 8966054373f0fe669c82390232006e2c18289430 (patch) | |
tree | 8815a1f2d6ff4cb4737d8217015581d52bd0e859 /CMakeLists.txt | |
parent | 0a2baec53bba75a7940a3f1eaf7743c601b711f2 (diff) |
Remove Qt translation generation and only use gettext for extracting translations
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index a56800925b..7d3d6f5c2b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,10 +12,7 @@ if(NOT ${URANIUM_SCRIPTS_DIR} STREQUAL "") # Build Translations find_package(Gettext) - find_package(Qt5LinguistTools QUIET CONFIG) - if(GETTEXT_FOUND AND Qt5LinguistTools_FOUND) - include(${URANIUM_SCRIPTS_DIR}/ECMPoQmTools.cmake) - + if(GETTEXT_FOUND) # translations target will convert .po files into .mo and .qm as needed. # The files are checked for a _qt suffix and if it is found, converted to # qm, otherwise they are converted to .po. @@ -36,26 +33,23 @@ if(NOT ${URANIUM_SCRIPTS_DIR} STREQUAL "") it es fi + pl + cs + bg ) foreach(lang ${languages}) file(GLOB po_files resources/i18n/${lang}/*.po) foreach(file ${po_files}) - string(REGEX MATCH "qt\\.po$" match "${file}") - if(match) - ecm_process_po_files_as_qm(${lang} PO_FILES ${file}) - else() - string(REGEX REPLACE ".*/(.*).po" "${lang}/\\1.mo" mofile ${file}) - add_custom_command(TARGET translations POST_BUILD COMMAND mkdir ARGS -p ${lang} COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} ARGS ${file} -o ${mofile}) - endif() + string(REGEX REPLACE ".*/(.*).po" "${lang}/\\1.mo" mofile ${file}) + add_custom_command(TARGET translations POST_BUILD COMMAND mkdir ARGS -p ${lang} COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} ARGS ${file} -o ${mofile}) endforeach() - file(GLOB qm_files ${CMAKE_BINARY_DIR}/${lang}/*.qm) file(GLOB mo_files ${CMAKE_BINARY_DIR}/${lang}/*.mo) - foreach(file ${qm_files} ${mo_files}) + foreach(file ${mo_files}) add_custom_command(TARGET copy-translations POST_BUILD COMMAND mkdir ARGS -p ${CMAKE_SOURCE_DIR}/resources/i18n/${lang}/LC_MESSAGES/ COMMAND cp ARGS ${file} ${CMAKE_SOURCE_DIR}/resources/i18n/${lang}/LC_MESSAGES/ COMMENT "Copying ${file}...") endforeach() - install(FILES ${qm_files} ${mo_files} DESTINATION ${CMAKE_INSTALL_DATADIR}/uranium/resources/i18n/${lang}/LC_MESSAGES/) + install(FILES ${mo_files} DESTINATION ${CMAKE_INSTALL_DATADIR}/uranium/resources/i18n/${lang}/LC_MESSAGES/) endforeach() endif() endif() |