Prevent .pot and .po from being cleaned#2
Open
nrbrook wants to merge 1 commit into
Open
Conversation
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`.
mjbogusz
reviewed
Feb 27, 2024
| 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 |
There was a problem hiding this comment.
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)
mjbogusz
reviewed
Feb 27, 2024
Comment on lines
103
to
104
| ${GETTEXT_SOURCES} | ||
| "--output=${GETTEXT_POTFILE_DESTINATION}/${GETTEXT_DOMAIN}.pot" |
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When using
add_custom_commandcmake automatically adds the files to the clean target. as.potand.pofiles should not be deleted, these have been changed toadd_custom_target.