Warning, /libraries/kproperty/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 # Distributed under the Boost Software License, Version 1.0.
0013 # (See accompanying file LICENSE_1_0.txt or copy at
0014 # http://www.boost.org/LICENSE_1_0.txt)
0015 
0016 set(HEAD_HASH)
0017 
0018 file(READ "@HEAD_FILE@" HEAD_CONTENTS LIMIT 1024)
0019 
0020 string(STRIP "${HEAD_CONTENTS}" HEAD_CONTENTS)
0021 if(HEAD_CONTENTS MATCHES "ref")
0022         # named branch
0023         string(REPLACE "ref: " "" HEAD_REF "${HEAD_CONTENTS}")
0024         if(EXISTS "@GIT_DIR@/${HEAD_REF}")
0025                 configure_file("@GIT_DIR@/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY)
0026         elseif(EXISTS "@GIT_DIR@/logs/${HEAD_REF}")
0027                 configure_file("@GIT_DIR@/logs/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY)
0028                 set(HEAD_HASH "${HEAD_REF}")
0029         endif()
0030 else()
0031         # detached HEAD
0032         configure_file("@GIT_DIR@/HEAD" "@GIT_DATA@/head-ref" COPYONLY)
0033 endif()
0034 
0035 if(NOT HEAD_HASH)
0036         file(READ "@GIT_DATA@/head-ref" HEAD_HASH LIMIT 1024)
0037         string(STRIP "${HEAD_HASH}" HEAD_HASH)
0038 endif()