summaryrefslogtreecommitdiffstats
path: root/Source/CMakeVersion.bash
diff options
context:
space:
mode:
Diffstat (limited to 'Source/CMakeVersion.bash')
-rwxr-xr-xSource/CMakeVersion.bash7
1 files changed, 7 insertions, 0 deletions
diff --git a/Source/CMakeVersion.bash b/Source/CMakeVersion.bash
new file mode 100755
index 0000000..126adba
--- /dev/null
+++ b/Source/CMakeVersion.bash
@@ -0,0 +1,7 @@
+#!/usr/bin/env bash
+# Update the version component if it looks like a date or -f is given.
+if test "x$1" = "x-f"; then shift ; n='*' ; else n='\{8\}' ; fi
+if test "$#" -gt 0; then echo 1>&2 "usage: CMakeVersion.bash [-f]"; exit 1; fi
+sed -i -e '
+s/\(^SET(CMake_VERSION_TWEAK\) [0-9]'"$n"'\(.*\)/\1 '"$(date +%Y%m%d)"'\2/
+' "${BASH_SOURCE%/*}/CMakeVersion.cmake"