Skip to content

Prevent .pot and .po from being cleaned#2

Open
nrbrook wants to merge 1 commit into
Skyb0rg007:masterfrom
nrbrook:patch-2
Open

Prevent .pot and .po from being cleaned#2
nrbrook wants to merge 1 commit into
Skyb0rg007:masterfrom
nrbrook:patch-2

Conversation

@nrbrook

@nrbrook nrbrook commented Nov 1, 2020

Copy link
Copy Markdown
Contributor

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`.
Comment thread Gettext_helpers.cmake
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

Copy link
Copy Markdown

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 thread Gettext_helpers.cmake
Comment on lines 103 to 104
${GETTEXT_SOURCES}
"--output=${GETTEXT_POTFILE_DESTINATION}/${GETTEXT_DOMAIN}.pot"

Copy link
Copy Markdown

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