]> git.saurik.com Git - apt.git/commitdiff
CMake: Translations: Make po templates depend on input files
authorJulian Andres Klode <jak@debian.org>
Sun, 7 Aug 2016 11:36:11 +0000 (13:36 +0200)
committerJulian Andres Klode <jak@debian.org>
Wed, 10 Aug 2016 14:10:57 +0000 (16:10 +0200)
I wondered why the template was not rebuilt after I changed a file,
now I have the answer.

Gbp-Dch: ignore

CMake/Translations.cmake

index 2a1e03d4c4cda72334728397663ebe0394d2e476..3a05d80b0b3fe76aad2fb13e998d0b6daeed6816 100644 (file)
@@ -5,6 +5,7 @@ function(apt_add_translation_domain domain)
     set(targets ${ARGN})
     # Build the list of source files of the target
     set(files "")
+    set(abs_files "")
     foreach(target ${targets})
         get_target_property(source_dir ${target} SOURCE_DIR)
         get_target_property(sources ${target} SOURCES)
@@ -18,6 +19,7 @@ function(apt_add_translation_domain domain)
             endif()
             file(RELATIVE_PATH relfile ${PROJECT_SOURCE_DIR} ${file})
             set(files ${files} ${relfile})
+            set(abs_files ${abs_files} ${file})
         endforeach()
 
         target_compile_definitions(${target} PRIVATE -DAPT_DOMAIN="${domain}")
@@ -27,6 +29,7 @@ function(apt_add_translation_domain domain)
     add_custom_command (OUTPUT ${PROJECT_BINARY_DIR}/${domain}.pot
         COMMAND xgettext --add-comments --foreign -k_ -kN_
                          -o ${PROJECT_BINARY_DIR}/${domain}.pot ${files}
+        DEPENDS ${abs_files}
         WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
     )