Debian Codegraph @

cmake/CheckGit.cmake

raw ◀ ▶
Source reconstructed at patch state 0 of 1 — not the installed (fully patched) source.
1 Debian patch touch this file
1 # In case Git is not available, default is empty string
2 set(GIT_HASH "")
3
4 find_package(Git QUIET)
5 if(GIT_FOUND)
6 execute_process(
7 COMMAND ${GIT_EXECUTABLE} describe --always --dirty
8 OUTPUT_VARIABLE D3_GIT_HASH
9 OUTPUT_STRIP_TRAILING_WHITESPACE
10 ERROR_QUIET
11 )
12 file(WRITE ${SOURCE_DIR}/git-hash.txt ${D3_GIT_HASH})
13 else()
14 # Try to read pregenerated file with commit hash on it (archive version of repository)
15 if(EXISTS ${SOURCE_DIR}/git-hash.txt)
16 file(READ ${SOURCE_DIR}/git-hash.txt D3_GIT_HASH)
17 endif()
18 endif()
19
20 message(STATUS "Git hash is ${D3_GIT_HASH}")
21
22 configure_file(
23 ${SOURCE_DIR}/lib/d3_version.h.in
24 ${TARGET_DIR}/lib/d3_version.h
25 @ONLY
26 )