Skip to content

Fix "cpm_add_patches" handling of multiple patch commands - #652

Closed
christopherbate wants to merge 1 commit into
cpm-cmake:masterfrom
christopherbate:cmake-fix-patch-command
Closed

Fix "cpm_add_patches" handling of multiple patch commands#652
christopherbate wants to merge 1 commit into
cpm-cmake:masterfrom
christopherbate:cmake-fix-patch-command

Conversation

@christopherbate

@christopherbate christopherbate commented Mar 4, 2025

Copy link
Copy Markdown

Update "cpm_add_patches" to correctly handle multiple patch files. The "PATCH_COMMAND" executor may not be a shell, so it is not portable to use shell operators like "&&" and "<" in the command. Commands after the initial PATCH_COMMAND should nstead be prefixed by COMMAND, and we can use "-i" to specify that a file is used by the "patch" command.

Resolves #651

Update "cpm_add_patches" to correctly handle multiple patch
files. The "PATCH_COMMAND" executor may not be a shell, so
it is not portable to use shell operators like "&&" and "<"
in the command. Commands after the initial PATCH_COMMAND
should nstead be prefixed by COMMAND, and we can use "-i"
to specify that a file is used by the "patch" command.
@christopherbate

Copy link
Copy Markdown
Author

@TheLartians can you review or can you approve workflows?

@TheLartians TheLartians left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the ping and fix! The changes look fine, but may require running cmake-format (see the project;s styleguide). Also do you think you could add / modify a test case to ensure multiple patches work as expected?

@christopherbate

Copy link
Copy Markdown
Author

Superseded by #664

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.

CPM Patch step incorrectly assumes CMake external command is executed in shell, fails to apply multiple patches listed in PATCHES

2 participants