forked from supercollider/supercollider
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSCVersion.txt
More file actions
49 lines (40 loc) · 1.29 KB
/
SCVersion.txt
File metadata and controls
49 lines (40 loc) · 1.29 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# This file is included by CMakeLists.txt and is the single place where SC version should be updated.
# Note that you need to "make install" for this information to be copied into all places.
set(SC_VERSION_MAJOR 3)
set(SC_VERSION_MINOR 15)
set(SC_VERSION_PATCH 0)
set(SC_VERSION_TWEAK "-dev")
set(SC_VERSION ${SC_VERSION_MAJOR}.${SC_VERSION_MINOR}.${SC_VERSION_PATCH}${SC_VERSION_TWEAK})
if(EXISTS "${CMAKE_SOURCE_DIR}/.git")
execute_process(
COMMAND git rev-parse --abbrev-ref HEAD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_BRANCH_OR_TAG
OUTPUT_STRIP_TRAILING_WHITESPACE
)
set(GIT_REF_TYPE "branch")
if(GIT_BRANCH_OR_TAG STREQUAL "HEAD")
execute_process(
COMMAND git describe --tags
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_BRANCH_OR_TAG
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET
)
if(GIT_BRANCH_OR_TAG STREQUAL "")
set(GIT_REF_TYPE "detached")
set(GIT_BRANCH_OR_TAG "HEAD")
else()
set(GIT_REF_TYPE "tag")
endif()
endif()
execute_process(
COMMAND git log -1 --format=%h
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_COMMIT_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
else()
SET(GIT_BRANCH not_a_git_checkout)
SET(GIT_COMMIT_HASH na)
endif()