summaryrefslogtreecommitdiffstats
path: root/Modules/VersionTag.cmake
diff options
context:
space:
mode:
authorGravatar Hector Martin2010-04-11 17:11:08 +0200
committerGravatar Hector Martin2010-04-11 17:18:50 +0200
commit3066c08a0db54729af639e128b4e9fe4fdc8c008 (patch)
treed1917b1b8ea7783bf4b566129088bab2258ef3cc /Modules/VersionTag.cmake
parent34524ac4e8075f0fc330759fd42b4d4873f27019 (diff)
downloadusbmuxd-3066c08a0db54729af639e128b4e9fe4fdc8c008.tar.gz
usbmuxd-3066c08a0db54729af639e128b4e9fe4fdc8c008.tar.bz2
Add automatic git versioning and tag for archives
Diffstat (limited to 'Modules/VersionTag.cmake')
-rw-r--r--Modules/VersionTag.cmake13
1 files changed, 13 insertions, 0 deletions
diff --git a/Modules/VersionTag.cmake b/Modules/VersionTag.cmake
new file mode 100644
index 0000000..682ab3e
--- /dev/null
+++ b/Modules/VersionTag.cmake
@@ -0,0 +1,13 @@
+execute_process(
+ COMMAND "sh" "${CMAKE_SOURCE_DIR}/Modules/describe.sh"
+ WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
+ OUTPUT_VARIABLE DESCRIBE
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+)
+
+if(DESCRIBE STREQUAL "")
+ set (VERSION_TAG "UNKNOWN")
+else()
+ string(REGEX REPLACE "^v" "" VERSION_TAG "${DESCRIBE}")
+endif()
+