Imported Upstream version 2.1.10
[platform/upstream/libevent.git] / cmake / FindGit.cmake
1 # The module defines the following variables:
2 #   GIT_EXECUTABLE - path to git command line client
3 #   GIT_FOUND - true if the command line client was found
4 # Example usage:
5 #   find_package(Git)
6 #   if(GIT_FOUND)
7 #     message("git found: ${GIT_EXECUTABLE}")
8 #   endif()
9
10 #=============================================================================
11 # Copyright 2010 Kitware, Inc.
12 #
13 # Distributed under the OSI-approved BSD License (the "License");
14 # see accompanying file Copyright.txt for details.
15 #
16 # This software is distributed WITHOUT ANY WARRANTY; without even the
17 # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 # See the License for more information.
19 #=============================================================================
20 # (To distributed this file outside of CMake, substitute the full
21 #  License text for the above reference.)
22
23 # Look for 'git' or 'eg' (easy git)
24 set(git_names git eg)
25
26 # Prefer .cmd variants on Windows unless running in a Makefile
27 # in the MSYS shell.
28 if(WIN32)
29   if(NOT CMAKE_GENERATOR MATCHES "MSYS")
30     set(git_names git.cmd git eg.cmd eg)
31   endif()
32 endif()
33
34 find_program(GIT_EXECUTABLE
35   NAMES ${git_names}
36   DOC "git command line client")
37
38 mark_as_advanced(GIT_EXECUTABLE)
39
40 # Handle the QUIETLY and REQUIRED arguments and set GIT_FOUND to TRUE if
41 # all listed variables are TRUE
42
43 include(FindPackageHandleStandardArgs)
44 find_package_handle_standard_args(Git DEFAULT_MSG GIT_EXECUTABLE)
45