5 # Find patch executable.
10 # This module defines the following variables:
14 # ``Patch_EXECUTABLE``
18 include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)
21 find_program(Patch_EXECUTABLE NAMES patch
23 "$ENV{LOCALAPPDATA}/Programs/Git/bin"
24 "$ENV{LOCALAPPDATA}/Programs/Git/usr/bin"
25 "$ENV{APPDATA}/Programs/Git/bin"
26 "$ENV{APPDATA}/Programs/Git/usr/bin"
28 mark_as_advanced(Patch_EXECUTABLE)
30 find_program(Patch_EXECUTABLE NAMES patch)
31 mark_as_advanced(Patch_EXECUTABLE)
34 if(EXISTS "${Patch_EXECUTABLE}")
35 execute_process(COMMAND ${Patch_EXECUTABLE} --version ERROR_QUIET OUTPUT_VARIABLE Patch_VERSION)
36 string(REGEX REPLACE ".*patch ([^\n ]+).*" "\\1" Patch_VERSION "${Patch_VERSION}")
39 find_package_handle_standard_args(Patch