Warning, /graphics/krita/cmake/modules/GetGitRevisionDescription.cmake.in is written in an unsupported language. File is not indexed.
0001 # 0002 # Internal file for GetGitRevisionDescription.cmake 0003 # 0004 # Requires CMake 2.6 or newer (uses the 'function' command) 0005 # 0006 # Original Author: 0007 # 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net> 0008 # http://academic.cleardefinition.com 0009 # Iowa State University HCI Graduate Program/VRAC 0010 # 0011 # Copyright Iowa State University 2009-2010. 0012 # 0013 # SPDX-License-Identifier: BSL-1.0 0014 # 0015 0016 set(HEAD_HASH) 0017 0018 file(READ "@HEAD_FILE@" HEAD_CONTENTS LIMIT 1024) 0019 0020 string(STRIP "${HEAD_CONTENTS}" HEAD_CONTENTS) 0021 set(GIT_DIR "@GIT_DIR@") 0022 # handle git-worktree 0023 if(EXISTS "${GIT_DIR}/commondir") 0024 file(READ "${GIT_DIR}/commondir" GIT_DIR_NEW LIMIT 1024) 0025 string(STRIP "${GIT_DIR_NEW}" GIT_DIR_NEW) 0026 if(NOT IS_ABSOLUTE "${GIT_DIR_NEW}") 0027 get_filename_component(GIT_DIR_NEW ${GIT_DIR}/${GIT_DIR_NEW} ABSOLUTE) 0028 endif() 0029 if(EXISTS "${GIT_DIR_NEW}") 0030 set(GIT_DIR "${GIT_DIR_NEW}") 0031 endif() 0032 endif() 0033 if(HEAD_CONTENTS MATCHES "ref") 0034 # named branch 0035 string(REPLACE "ref: " "" HEAD_REF "${HEAD_CONTENTS}") 0036 if(EXISTS "${GIT_DIR}/${HEAD_REF}") 0037 configure_file("${GIT_DIR}/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY) 0038 elseif(EXISTS "${GIT_DIR}/logs/${HEAD_REF}") 0039 configure_file("${GIT_DIR}/logs/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY) 0040 set(HEAD_HASH "${HEAD_REF}") 0041 endif() 0042 else() 0043 # detached HEAD 0044 configure_file("${GIT_DIR}/HEAD" "@GIT_DATA@/head-ref" COPYONLY) 0045 endif() 0046 0047 if(NOT HEAD_HASH) 0048 file(READ "@GIT_DATA@/head-ref" HEAD_HASH LIMIT 1024) 0049 string(STRIP "${HEAD_HASH}" HEAD_HASH) 0050 endif()