aboutsummaryrefslogtreecommitdiffstats
path: root/version.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'version.cmake')
-rw-r--r--version.cmake11
1 files changed, 11 insertions, 0 deletions
diff --git a/version.cmake b/version.cmake
new file mode 100644
index 00000000..af7ff0a6
--- /dev/null
+++ b/version.cmake
@@ -0,0 +1,11 @@
+EXECUTE_PROCESS(
+ COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD
+ OUTPUT_VARIABLE GIT_BRANCH
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+)
+EXECUTE_PROCESS(
+ COMMAND ${GIT_EXECUTABLE} log -1 --format=%h
+ OUTPUT_VARIABLE GIT_COMMIT_HASH
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+)
+CONFIGURE_FILE(${SRC} ${DST})