diff options
author | Stefan Brüns <stefan.bruens@rwth-aachen.de> | 2024-04-01 16:56:26 +0200 |
---|---|---|
committer | Stefan Brüns <stefan.bruens@rwth-aachen.de> | 2024-04-01 19:47:50 +0200 |
commit | ff055f872aa31a548e1d73f4ea0d9394ba39d62c (patch) | |
tree | 4f2f77969347c51b61d1ebccf54bf9a196fe13cd | |
parent | 0aa1fe5c30a6c467c91bad8d81bd6c2f57fcb726 (diff) |
Regenerate pot/po files only if input has changed
A custom target with ALL is always generated, even if the files/outputs
specified with DPENDS are not changed.
This can be solved by generating the POT files with a custom_command.
The target triggers evaluation of the custom_command, but the latter will
only be run if the dependencies have changed.
Fixes #1479
-rw-r--r-- | utils/po/CMakeLists.txt | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/utils/po/CMakeLists.txt b/utils/po/CMakeLists.txt index 5cd3a903..2eb7f0f0 100644 --- a/utils/po/CMakeLists.txt +++ b/utils/po/CMakeLists.txt @@ -15,12 +15,14 @@ macro(UPDATE_POT_FILE input) list(APPEND _commands COMMAND ${GETTEXT_MSGMERGE_EXECUTABLE} --quiet --update --backup=none -s ${_poFile} "${CMAKE_CURRENT_SOURCE_DIR}/${_potFile}") endforeach() - add_custom_target(update_pot_${input} - ALL + add_custom_command(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/${_potFile} COMMAND xgettext --keyword=_ --language=c++ --package-name=pdfsig --output-dir=po --output=${_potFile} ${input}.cc ${_commands} - DEPENDS ../${input}.cc + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/../${input}.cc WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/..) + add_custom_target(update_pot_${input} + ALL + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_potFile}) endmacro() UPDATE_POT_FILE(pdfsig) |