forked from svenreiche/Genesis-1.3-Version4
-
Notifications
You must be signed in to change notification settings - Fork 0
/
git-hash.cmake
29 lines (29 loc) · 887 Bytes
/
git-hash.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# generation of the version include file
SET(GIT_HASH "unknown")
find_package(Git QUIET)
if (GIT_FOUND)
execute_process(
COMMAND ${GIT_EXECUTABLE} log -1 --pretty=format:%H
OUTPUT_VARIABLE GIT_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET
WORKING_DIRECTORY
${CMAKE_CURRENT_SOURCE_DIR}
)
endif()
message(STATUS "Git hash is ${GIT_HASH}")
set(_GENESIS_VERSION_MAJOR "4")
set(_GENESIS_VERSION_MINOR "6")
set(_GENESIS_VERSION_REV "6")
set(_GENESIS_VERSION_BETA "false")
execute_process(
COMMAND
whoami
TIMEOUT
1
OUTPUT_VARIABLE
_user_name
OUTPUT_STRIP_TRAILING_WHITESPACE
)
string(TIMESTAMP _config_time "%Y-%m-%d %H:%M:%S [UTC]" UTC)
configure_file(${CMAKE_CURRENT_LIST_DIR}/include/version.h.in ${TARGET_DIR}/include/version.h @ONLY)