Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent .pot and .po from being cleaned #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nrbrook
Copy link
Contributor

@nrbrook nrbrook commented Nov 1, 2020

When using add_custom_command cmake automatically adds the files to the clean target. as .pot and .po files should not be deleted, these have been changed to add_custom_target.

When using `add_custom_command` cmake automatically adds the files to the clean target. as `.pot` and `.po` files should not be deleted, these have been changed to `add_custom_target`.
add_custom_command(
OUTPUT "${GETTEXT_POTFILE_DESTINATION}/${GETTEXT_DOMAIN}.pot"
# should use add_custom_target so .pot doesn't get cleaned
add_custom_target(${TARGET_NAME}_gen_pot

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
add_custom_target(${TARGET_NAME}_gen_pot
add_custom_target(${TARGET_NAME}_gen_pot
BYPRODUCTS "${GETTEXT_POTFILE_DESTINATION}/${GETTEXT_DOMAIN}.pot"

for parity with add_custom_command's OUTPUT; same applies to line 129 (per-language .po file targets)

Comment on lines 103 to 104
${GETTEXT_SOURCES}
"--output=${GETTEXT_POTFILE_DESTINATION}/${GETTEXT_DOMAIN}.pot"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
${GETTEXT_SOURCES}
"--output=${GETTEXT_POTFILE_DESTINATION}/${GETTEXT_DOMAIN}.pot"
${GETTEXT_SOURCES}
"--output=${GETTEXT_POTFILE_DESTINATION}/${GETTEXT_DOMAIN}.pot"
"--join-existing"
"--force-po"

join-existing improves upon the idea of this PR by not throwing out previously created .pot, while force-po makes the generation more consistent.

While these flags could be passed through XGETTEXT_ARGS they are not really project-dependent like, say, sort-output. Additionally it would require anyone using this project to comb through gettext util's documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants