Skip to content

Commit b0edc0f

Browse files
feat: get git version and hash
1 parent 6d54a79 commit b0edc0f

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

CMakeLists.txt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
22
PROJECT(proxyme)
33

4-
# The version number.
4+
# get the git tag and hash
55
exec_program(
66
"git"
77
${CMAKE_CURRENT_SOURCE_DIR}
88
ARGS "name-rev --tags --name-only $(git rev-parse HEAD)"
9-
OUTPUT_VARIABLE proxyme_VERSION )
10-
set (proxyme_VERSION ${proxyme_VERSION})
9+
OUTPUT_VARIABLE proxyme_GITTAG )
10+
exec_program(
11+
"git"
12+
${CMAKE_CURRENT_SOURCE_DIR}
13+
ARGS "rev-parse --short HEAD"
14+
OUTPUT_VARIABLE proxyme_GITHASH )
15+
set (proxyme_VERSION "${proxyme_GITTAG} (${proxyme_GITHASH})")
1116

1217
# configure a header file to pass some of the CMake settings
1318
# to the source code

0 commit comments

Comments
 (0)