aboutsummaryrefslogtreecommitdiff
path: root/src/version.cmake
diff options
context:
space:
mode:
authorAntonio Juarez <antonio.maria.juarez@live.com>2014-03-03 22:07:58 +0000
committerAntonio Juarez <antonio.maria.juarez@live.com>2014-03-03 22:07:58 +0000
commit296ae46ed8f8f6e5f986f978febad302e3df231a (patch)
tree1629164454a239308f33c9e12afb22e7f3cd8eeb /src/version.cmake
parentchanged name (diff)
downloadmonero-296ae46ed8f8f6e5f986f978febad302e3df231a.tar.xz
moved all stuff to github
Diffstat (limited to 'src/version.cmake')
-rw-r--r--src/version.cmake11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/version.cmake b/src/version.cmake
new file mode 100644
index 000000000..880224dc6
--- /dev/null
+++ b/src/version.cmake
@@ -0,0 +1,11 @@
+execute_process(COMMAND "${GIT}" describe --dirty --match "v${VERSION}" RESULT_VARIABLE RET OUTPUT_VARIABLE DESCRIPTION OUTPUT_STRIP_TRAILING_WHITESPACE)
+if(RET)
+ message(WARNING "Cannot determine current revision. Make sure that you are building either from a Git working tree or from a source archive.")
+ set(VERSION "${COMMIT}")
+ configure_file("src/version.h.in" "${TO}")
+else()
+ string(REGEX MATCH "([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f])?(-dirty)? $" COMMIT "${DESCRIPTION} ")
+ string(STRIP "${COMMIT}" COMMIT)
+ set(VERSION "${COMMIT}")
+ configure_file("src/version.h.in" "${TO}")
+endif() \ No newline at end of file