Skip to content

Commit d3cae39

Browse files
authored
Merge branch 'master' into warn_users_about_patches
2 parents d835a0e + 0bc73f4 commit d3cae39

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

cmake/CPM.cmake

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -477,13 +477,16 @@ function(cpm_add_patches)
477477
find_program(PATCH_EXECUTABLE patch)
478478
if(WIN32 AND NOT PATCH_EXECUTABLE)
479479
# The Windows git executable is distributed with patch.exe. Find the path to the executable, if
480-
# it exists, then search `../../usr/bin` for patch.exe.
480+
# it exists, then search `../usr/bin` and `../../usr/bin` for patch.exe.
481481
find_package(Git QUIET)
482482
if(GIT_EXECUTABLE)
483483
get_filename_component(extra_search_path ${GIT_EXECUTABLE} DIRECTORY)
484-
get_filename_component(extra_search_path ${extra_search_path} DIRECTORY)
485-
get_filename_component(extra_search_path ${extra_search_path} DIRECTORY)
486-
find_program(PATCH_EXECUTABLE patch HINTS "${extra_search_path}/usr/bin")
484+
get_filename_component(extra_search_path_1up ${extra_search_path} DIRECTORY)
485+
get_filename_component(extra_search_path_2up ${extra_search_path_1up} DIRECTORY)
486+
find_program(
487+
PATCH_EXECUTABLE patch HINTS "${extra_search_path_1up}/usr/bin"
488+
"${extra_search_path_2up}/usr/bin"
489+
)
487490
endif()
488491
endif()
489492
if(NOT PATCH_EXECUTABLE)

0 commit comments

Comments
 (0)