diff options
Diffstat (limited to 'contrib/SDL-3.2.8/cmake/GetGitRevisionDescription.cmake.in')
| -rw-r--r-- | contrib/SDL-3.2.8/cmake/GetGitRevisionDescription.cmake.in | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/contrib/SDL-3.2.8/cmake/GetGitRevisionDescription.cmake.in b/contrib/SDL-3.2.8/cmake/GetGitRevisionDescription.cmake.in new file mode 100644 index 0000000..116efc4 --- /dev/null +++ b/contrib/SDL-3.2.8/cmake/GetGitRevisionDescription.cmake.in | |||
| @@ -0,0 +1,43 @@ | |||
| 1 | # | ||
| 2 | # Internal file for GetGitRevisionDescription.cmake | ||
| 3 | # | ||
| 4 | # Requires CMake 2.6 or newer (uses the 'function' command) | ||
| 5 | # | ||
| 6 | # Original Author: | ||
| 7 | # 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net> | ||
| 8 | # http://academic.cleardefinition.com | ||
| 9 | # Iowa State University HCI Graduate Program/VRAC | ||
| 10 | # | ||
| 11 | # Copyright 2009-2012, Iowa State University | ||
| 12 | # Copyright 2011-2015, Contributors | ||
| 13 | # Distributed under the Boost Software License, Version 1.0. | ||
| 14 | # (See accompanying file LICENSE_1_0.txt or copy at | ||
| 15 | # http://www.boost.org/LICENSE_1_0.txt) | ||
| 16 | # SPDX-License-Identifier: BSL-1.0 | ||
| 17 | |||
| 18 | set(HEAD_HASH) | ||
| 19 | |||
| 20 | file(READ "@HEAD_FILE@" HEAD_CONTENTS LIMIT 1024) | ||
| 21 | |||
| 22 | string(STRIP "${HEAD_CONTENTS}" HEAD_CONTENTS) | ||
| 23 | if(HEAD_CONTENTS MATCHES "ref") | ||
| 24 | # named branch | ||
| 25 | string(REPLACE "ref: " "" HEAD_REF "${HEAD_CONTENTS}") | ||
| 26 | if(EXISTS "@GIT_DIR@/${HEAD_REF}") | ||
| 27 | configure_file("@GIT_DIR@/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY) | ||
| 28 | else() | ||
| 29 | configure_file("@GIT_DIR@/packed-refs" "@GIT_DATA@/packed-refs" COPYONLY) | ||
| 30 | file(READ "@GIT_DATA@/packed-refs" PACKED_REFS) | ||
| 31 | if(${PACKED_REFS} MATCHES "([0-9a-z]*) ${HEAD_REF}") | ||
| 32 | set(HEAD_HASH "${CMAKE_MATCH_1}") | ||
| 33 | endif() | ||
| 34 | endif() | ||
| 35 | else() | ||
| 36 | # detached HEAD | ||
| 37 | configure_file("@GIT_DIR@/HEAD" "@GIT_DATA@/head-ref" COPYONLY) | ||
| 38 | endif() | ||
| 39 | |||
| 40 | if(NOT HEAD_HASH) | ||
| 41 | file(READ "@GIT_DATA@/head-ref" HEAD_HASH LIMIT 1024) | ||
| 42 | string(STRIP "${HEAD_HASH}" HEAD_HASH) | ||
| 43 | endif() | ||
