From 278147f6e146a59f58e13d6cb2bf353b7c66a5b6 Mon Sep 17 00:00:00 2001 From: Daniel Lemire Date: Tue, 16 Jul 2024 11:39:19 -0400 Subject: [PATCH] fix: add --batch flag to PATCH_EXECUTABLE command --- cmake/CPM.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmake/CPM.cmake b/cmake/CPM.cmake index b273c3bb..0b0098e1 100644 --- a/cmake/CPM.cmake +++ b/cmake/CPM.cmake @@ -516,7 +516,9 @@ function(cpm_add_patches) list(APPEND temp_list "&&") endif() # Add the patch command to the list - list(APPEND temp_list "${PATCH_EXECUTABLE}" "-p1" "<" "${PATCH_FILE}") + # The --batch flag is used to prevent the patch command from asking for user input + # and it does not apply the patch if it is unnecessary. + list(APPEND temp_list "${PATCH_EXECUTABLE}" "--batch" "-p1" "<" "${PATCH_FILE}") endforeach() # Move temp out into parent scope.