Prechádzať zdrojové kódy

CMake: Translations: Write a .po file before writing a .mo file

This makes debugging things easier.

Gbp-Dch: ignore
Julian Andres Klode 10 rokov pred
rodič
commit
a331fb7016
1 zmenil súbory, kde vykonal 6 pridanie a 3 odobranie
  1. 6 3
      CMake/Translations.cmake

+ 6 - 3
CMake/Translations.cmake

@@ -42,11 +42,14 @@ function(apt_add_translation_domain domain)
         set(outdir ${PROJECT_BINARY_DIR}/locale/${langcode}/LC_MESSAGES)
         set(outdir ${PROJECT_BINARY_DIR}/locale/${langcode}/LC_MESSAGES)
         file(MAKE_DIRECTORY ${outdir})
         file(MAKE_DIRECTORY ${outdir})
         # Command to merge and compile the messages
         # Command to merge and compile the messages
-        add_custom_command(OUTPUT ${outdir}/${domain}.mo
-            COMMAND msgmerge -qo - ${file} ${PROJECT_BINARY_DIR}/${domain}.pot |
-                    msgfmt --statistics -o ${outdir}/${domain}.mo -
+        add_custom_command(OUTPUT ${outdir}/${domain}.po
+            COMMAND msgmerge -qo ${outdir}/${domain}.po ${file} ${PROJECT_BINARY_DIR}/${domain}.pot
             DEPENDS ${file} ${PROJECT_BINARY_DIR}/${domain}.pot
             DEPENDS ${file} ${PROJECT_BINARY_DIR}/${domain}.pot
         )
         )
+        add_custom_command(OUTPUT ${outdir}/${domain}.mo
+            COMMAND msgfmt --statistics -o ${outdir}/${domain}.mo  ${outdir}/${domain}.po
+            DEPENDS ${outdir}/${domain}.po
+        )
 
 
         set(mofiles ${mofiles} ${outdir}/${domain}.mo)
         set(mofiles ${mofiles} ${outdir}/${domain}.mo)
         install(FILES ${outdir}/${domain}.mo
         install(FILES ${outdir}/${domain}.mo