summaryrefslogtreecommitdiff
path: root/CMake/Translations.cmake
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2016-08-19 15:52:14 +0200
committerJulian Andres Klode <jak@debian.org>2016-08-19 15:54:25 +0200
commitade5888b4107f3181abd2a7dd15d8b2b4a997f82 (patch)
treee786a435c522e1125daf54d9f6a82c3d699be5b0 /CMake/Translations.cmake
parentf23ca86fe037f13f744c588b07e4c9140a534894 (diff)
CMake: Translations: Don't rebuild .mo for line number changes
If only the line numbers changed in a file without any of the translatable strings changing, the .po and .mo files were rebuilt, making building simple code changes somewhat annoying. We can work around this by passing --add-location=file to msgcomm when we are creating the temporary .pot file used for building the .mo files.
Diffstat (limited to 'CMake/Translations.cmake')
-rw-r--r--CMake/Translations.cmake5
1 files changed, 4 insertions, 1 deletions
diff --git a/CMake/Translations.cmake b/CMake/Translations.cmake
index 509e4e378..d7e992b3e 100644
--- a/CMake/Translations.cmake
+++ b/CMake/Translations.cmake
@@ -67,13 +67,16 @@ function(apt_add_translation_domain)
# build a ${domain.pot}-tmp as a byproduct. The msgfmt command than depend
# on the byproduct while their target depends on the output, so that msgfmt
# does not have to be rerun if nothing in the template changed.
+ #
+ # Make sure the .pot-tmp has no line numbers, to avoid useless rebuilding
+ # of .mo files.
add_custom_command (OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${domain}.pot
BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/${domain}.pot-tmp
COMMAND msgcomm --more-than=0 --sort-by-file
${sh_pot}
${CMAKE_CURRENT_BINARY_DIR}/${domain}.c.pot
--output=${CMAKE_CURRENT_BINARY_DIR}/${domain}.pot
- COMMAND msgcomm --more-than=0 --omit-header --sort-by-file
+ COMMAND msgcomm --more-than=0 --omit-header --sort-by-file --add-location=file
${sh_pot}
${CMAKE_CURRENT_BINARY_DIR}/${domain}.c.pot
--output=${CMAKE_CURRENT_BINARY_DIR}/${domain}.pot-tmp0