1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
|
if(DEFINED __INCLUDED_BLADERF_FIND_PATCHER)
return()
endif()
set(__INCLUDED_BLADERF_FIND_PATCHER TRUE)
# Look for the packages we want
find_package(Patch QUIET)
find_package(Git QUIET)
# Work around cross-platform case sensitivity issues
if(PATCH_FOUND)
set(Patch_FOUND ${PATCH_FOUND})
if (PATCH_EXECUTABLE)
set(Patch_EXECUTABLE ${PATCH_EXECUTABLE})
endif()
endif()
if(GIT_FOUND)
set(Git_FOUND ${GIT_FOUND})
if (GIT_EXECUTABLE)
set(Git_EXECUTABLE ${GIT_EXECUTABLE})
endif()
endif()
# patch is preferred, but git-apply is also okay.
if(Patch_FOUND)
set(Patcher_FOUND TRUE)
set(Patcher_EXECUTABLE ${Patch_EXECUTABLE})
elseif(Git_FOUND)
set(Patcher_FOUND TRUE)
set(Patcher_EXECUTABLE ${Git_EXECUTABLE};--bare;apply;-)
else()
set(Patcher_FOUND FALSE)
endif()
if(NOT Patcher_FOUND AND Patcher_FIND_REQUIRED)
message(FATAL_ERROR "FindPatcher: Could not find either 'patch' or 'git'!")
endif()
if(Patcher_FOUND AND NOT Patcher_FIND_QUIETLY)
message(STATUS "FindPatcher: found ${Patcher_EXECUTABLE}")
endif()
|