Advertisement
GenuineSounds

Dat Syntax

Dec 5th, 2014
249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CMake 1.89 KB | None | 0 0
  1. # Copyright (C) 2011-2014 Project SkyFire <http://www.projectskyfire.org/>
  2. # Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
  3. #
  4. # This file is free software; as a special exception the author gives
  5. # unlimited permission to copy and/or distribute it, with or without
  6. # modifications, as long as this notice is preserved.
  7. #
  8. # This program is distributed in the hope that it will be useful, but
  9. # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
  10. # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  11.  
  12. include(${CMAKE_SOURCE_DIR}/cmake/macros/EnsureVersion.cmake)
  13.  
  14. set(_REQUIRED_GIT_VERSION "1.7")
  15.  
  16. find_program(GIT_EXECUTABLE
  17.   NAMES
  18.     git git.cmd
  19.   HINTS
  20.     ENV PATH
  21.   DOC "Full path to git commandline client"
  22. )
  23. MARK_AS_ADVANCED(GIT_EXECUTABLE)
  24.  
  25. if(NOT GIT_EXECUTABLE)
  26.   message(FATAL_ERROR "
  27.    Git was NOT FOUND on your system - did you forget to install a recent version, or setting the path to it?
  28.    Observe that for revision hash/date to work you need at least version ${_REQUIRED_GIT_VERSION}")
  29. else()
  30.   message(STATUS "Found git binary : ${GIT_EXECUTABLE}")
  31.   execute_process(
  32.     COMMAND "${GIT_EXECUTABLE}" --version
  33.     WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
  34.     OUTPUT_VARIABLE _GIT_VERSION
  35.     ERROR_QUIET
  36.   )
  37.  
  38.   # make sure we're using minimum the required version of git, so the "dirty-testing" will work properly
  39.   ensure_version( "${_REQUIRED_GIT_VERSION}" "${_GIT_VERSION}" _GIT_VERSION_OK)
  40.  
  41.   # throw an error if we don't have a recent enough version of git...
  42.   if(NOT _GIT_VERSION_OK)
  43.     message(STATUS "Git version too old : ${_GIT_VERSION}")
  44.     message(FATAL_ERROR "
  45.      Git was found but is OUTDATED - did you forget to install a recent version, or setting the path to it?
  46.      Observe that for revision hash/date to work you need at least version ${_REQUIRED_GIT_VERSION}")
  47.   endif()
  48. endif()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement