gnucash unstable: gnucash.pot target improvements

Geert Janssens gjanssens at code.gnucash.org
Mon Jan 29 15:51:47 EST 2018


Updated	 via  https://github.com/Gnucash/gnucash/commit/99ebeb6b (commit)
	from  https://github.com/Gnucash/gnucash/commit/6e5ac260 (commit)



commit 99ebeb6b5d49e29e16dd18eb82418f6741c1303d
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Mon Jan 29 21:51:38 2018 +0100

    gnucash.pot target improvements
    
    - add simple target called 'pot' so translators can run 'make pot'
    - make gnucash.pot depend on all files with translatable strings. So whenever
      one of these files is changed the potfile will automatically be regenerated
      (if the current target depends on it, like 'pot' or 'dist')
    
    Note the default target (make without anything) does not depend on gnucash.pot
    so the potfile will not automatically be (re)generated when building that target.

diff --git a/po/CMakeLists.txt b/po/CMakeLists.txt
index 50544ab..3069c1d8 100644
--- a/po/CMakeLists.txt
+++ b/po/CMakeLists.txt
@@ -114,6 +114,13 @@ FUNCTION(MAKE_GNUCASH_POTFILES)
   )
   STRING(REPLACE "\n" ";" POTFILES "${POTFILES_IN}")
 
+  # These are manually added, because they're not picked up by the generation script
+  list(APPEND POTFILES
+    "gnucash/gnome/gnucash.appdata.xml.in"
+    "gnucash/gnome/gnucash.desktop.in.in"
+    "libgnucash/engine/qofbookslots.h"
+    "doc/tip_of_the_day.list.in")
+
   # Write out the final list.
   # intltool-update insists that this file be in the source directory. :-(
   SET(POTFILES_IN_PATH ${CMAKE_CURRENT_BINARY_DIR}/POTFILES.in)
@@ -121,7 +128,9 @@ FUNCTION(MAKE_GNUCASH_POTFILES)
 # This file was autogenerated by cmake.
 ")
 
+  set(POTFILE_DEPS "")
   FOREACH(path ${POTFILES})
+    list(APPEND POTFILE_DEPS ${CMAKE_SOURCE_DIR}/${path})
     STRING(REGEX MATCH gschema.xml.in.in IS_GSCHEMA ${path})
     IF(IS_GSCHEMA)
       # Force parse type for gsettings files
@@ -130,13 +139,9 @@ FUNCTION(MAKE_GNUCASH_POTFILES)
     FILE(APPEND ${POTFILES_IN_PATH} "${path}\n")
   ENDFOREACH()
 
-  # These are manually added, because they're not picked up by the generation script
-  FILE(APPEND ${POTFILES_IN_PATH} "gnucash/gnome/gnucash.appdata.xml.in
-gnucash/gnome/gnucash.desktop.in.in
-libgnucash/engine/qofbookslots.h
-doc/tip_of_the_day.list.in
-")
   CONFIGURE_FILE(${POTFILES_IN_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/POTFILES.in NEWLINE_STYLE LF)
+
+  set(gnucash_pot_depends ${POTFILE_DEPS}  CACHE INTERNAL "List of files with translatable strings. If any of these change, gnucash.pot should be regenerated")
 ENDFUNCTION()
 
 find_program(INTLTOOL_UPDATE NAMES intltool-update)
@@ -169,8 +174,10 @@ IF(BUILDING_FROM_VCS)
            -D PERL=${PERL_EXECUTABLE}
            -D XGETTEXT=${XGETTEXT}
            -P ${CMAKE_CURRENT_SOURCE_DIR}/gnucash-pot.cmake
+        DEPENDS ${gnucash_pot_depends}
         WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
   )
+  add_custom_target (pot DEPENDS gnucash.pot)
 ENDIF()
 dist_add_generated(gnucash.pot)
 



Summary of changes:
 po/CMakeLists.txt | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)



More information about the gnucash-changes mailing list