Skip to content

Commit

Permalink
Merge branch 'master' into warn_users_about_patches
Browse files Browse the repository at this point in the history
  • Loading branch information
lemire authored Sep 30, 2024
2 parents d835a0e + 0bc73f4 commit d3cae39
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions cmake/CPM.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -477,13 +477,16 @@ function(cpm_add_patches)
find_program(PATCH_EXECUTABLE patch)
if(WIN32 AND NOT PATCH_EXECUTABLE)
# The Windows git executable is distributed with patch.exe. Find the path to the executable, if
# it exists, then search `../../usr/bin` for patch.exe.
# it exists, then search `../usr/bin` and `../../usr/bin` for patch.exe.
find_package(Git QUIET)
if(GIT_EXECUTABLE)
get_filename_component(extra_search_path ${GIT_EXECUTABLE} DIRECTORY)
get_filename_component(extra_search_path ${extra_search_path} DIRECTORY)
get_filename_component(extra_search_path ${extra_search_path} DIRECTORY)
find_program(PATCH_EXECUTABLE patch HINTS "${extra_search_path}/usr/bin")
get_filename_component(extra_search_path_1up ${extra_search_path} DIRECTORY)
get_filename_component(extra_search_path_2up ${extra_search_path_1up} DIRECTORY)
find_program(
PATCH_EXECUTABLE patch HINTS "${extra_search_path_1up}/usr/bin"
"${extra_search_path_2up}/usr/bin"
)
endif()
endif()
if(NOT PATCH_EXECUTABLE)
Expand Down

0 comments on commit d3cae39

Please sign in to comment.