]> git.saurik.com Git - apt.git/commitdiff
CMake: Translations: Write a .po file before writing a .mo file
authorJulian Andres Klode <jak@debian.org>
Sun, 7 Aug 2016 13:50:04 +0000 (15:50 +0200)
committerJulian Andres Klode <jak@debian.org>
Wed, 10 Aug 2016 14:11:04 +0000 (16:11 +0200)
This makes debugging things easier.

Gbp-Dch: ignore

CMake/Translations.cmake

index 64f5886fbaea223e89b2cafb2b31c941bf1316ea..a26bf1c171bbd72e9f5fdcdcf1d6b5fbe8354943 100644 (file)
@@ -42,11 +42,14 @@ function(apt_add_translation_domain domain)
         set(outdir ${PROJECT_BINARY_DIR}/locale/${langcode}/LC_MESSAGES)
         file(MAKE_DIRECTORY ${outdir})
         # Command to merge and compile the messages
         set(outdir ${PROJECT_BINARY_DIR}/locale/${langcode}/LC_MESSAGES)
         file(MAKE_DIRECTORY ${outdir})
         # 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)
         install(FILES ${outdir}/${domain}.mo
 
         set(mofiles ${mofiles} ${outdir}/${domain}.mo)
         install(FILES ${outdir}/${domain}.mo