Skip to content

Fix "cpm_add_patches" handling of multiple patch commands #652

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions cmake/CPM.cmake
Original file line number Diff line number Diff line change
@@ -529,16 +529,16 @@ function(cpm_add_patches)
# Convert to absolute path for use with patch file command.
get_filename_component(PATCH_FILE "${PATCH_FILE}" ABSOLUTE)

# The first patch entry must be preceded by "PATCH_COMMAND" while the following items are
# preceded by "&&".
# The first patch entry must be preceded by "PATCH_COMMAND". Subsequent
# commands are preceeded by "COMMAND".
if(first_item)
set(first_item False)
list(APPEND temp_list "PATCH_COMMAND")
else()
list(APPEND temp_list "&&")
list(APPEND temp_list "COMMAND")
endif()
# Add the patch command to the list
list(APPEND temp_list "${PATCH_EXECUTABLE}" "-p1" "<" "${PATCH_FILE}")
list(APPEND temp_list "${PATCH_EXECUTABLE}" "-p1" "-i" "${PATCH_FILE}")
endforeach()

# Move temp out into parent scope.
Loading
Oops, something went wrong.