]> git.mxchange.org Git - flightgear.git/blob - CMakeModules/FindGit.cmake
initial commit for a python based terrasync client
[flightgear.git] / CMakeModules / 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 distribute 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 #
25 set(git_names git eg)
26
27 # Prefer .cmd variants on Windows unless running in a Makefile
28 # in the MSYS shell.
29 #
30 if(WIN32)
31   if(NOT CMAKE_GENERATOR MATCHES "MSYS")
32     set(git_names git.cmd git eg.cmd eg)
33   endif()
34 endif()
35
36 find_program(GIT_EXECUTABLE
37   NAMES ${git_names}
38   DOC "git command line client"
39   )
40 mark_as_advanced(GIT_EXECUTABLE)
41
42 # Handle the QUIETLY and REQUIRED arguments and set GIT_FOUND to TRUE if
43 # all listed variables are TRUE
44
45 include(FindPackageHandleStandardArgs)
46 find_package_handle_standard_args(Git DEFAULT_MSG GIT_EXECUTABLE)