diff options
author | Ismael Asensio <isma.af@gmail.com> | 2025-01-13 23:50:46 +0100 |
---|---|---|
committer | Albert Astals Cid <aacid@kde.org> | 2025-01-13 23:53:42 +0100 |
commit | 50dd001dba665c9fa08316c26e28c2b906eec78a (patch) | |
tree | 9b8b75b6588c3163bb1b791d7c7dea2afb96698b | |
parent | eac3e60144d63581fe71be405a4de64af75a8563 (diff) |
utils/po: Create temporary .pot.new file in build dir
This command creates a `.pot.new` temporary file to check for changes
in translation strings, and avoid modifying the source ".pot" file on
trivial date changes.
Create the temporary file in the build dir, instead of the source dir
-rw-r--r-- | utils/po/CMakeLists.txt | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/utils/po/CMakeLists.txt b/utils/po/CMakeLists.txt index 38e1fd44..ef361776 100644 --- a/utils/po/CMakeLists.txt +++ b/utils/po/CMakeLists.txt @@ -16,23 +16,23 @@ macro(UPDATE_POT_FILE input) COMMAND ${GETTEXT_MSGMERGE_EXECUTABLE} --quiet --update --backup=none -F ${_poFile} "${CMAKE_CURRENT_SOURCE_DIR}/${_potFile}") endforeach() - set(COPY_NEW_POTFILE ${CMAKE_COMMAND} -E copy po/${_potFile}.new po/${_potFile}) + set(COPY_NEW_POTFILE ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/${_potFile}.new ${CMAKE_CURRENT_SOURCE_DIR}/${_potFile}) if (NOT (${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Windows")) # IF the new potfile carries changes other than an updated POT-creation-date (autogenerated) THEN proceed to use that new potfile - set(CM diff --brief --ignore-matching-lines="POT-Creation-Date.*" po/${_potFile} po/${_potFile}.new || ${COPY_NEW_POTFILE}) + set(CM diff --brief --ignore-matching-lines="POT-Creation-Date.*" ${CMAKE_CURRENT_SOURCE_DIR}/${_potFile} ${CMAKE_CURRENT_BINARY_DIR}/${_potFile}.new || ${COPY_NEW_POTFILE}) else () set(CM ${COPY_NEW_POTFILE}) endif () - add_custom_command(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/${_potFile}.new - COMMAND xgettext ${input}.cc --package-name=${input} --keyword=_ -F --output=po/${_potFile}.new + add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_potFile}.new + COMMAND xgettext ${input}.cc --package-name=${input} --keyword=_ -F --output="${CMAKE_CURRENT_BINARY_DIR}/${_potFile}.new" COMMAND ${CM} ${_commands} DEPENDS ../${input}.cc WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/..) add_custom_target(update_pot_${input} ALL - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_potFile}.new) + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${_potFile}.new) endmacro() UPDATE_POT_FILE(pdfsig) |