diff options
author | Brad King <brad.king@kitware.com> | 2012-04-20 15:20:48 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2012-04-20 15:25:55 (GMT) |
commit | 0c7029c6420d6387b74a85bb8e62194e80b4e879 (patch) | |
tree | 32cf9f5b3d8c1098c06712930cfc890c8bbf73dd /Source/CMakeVersion.bash | |
parent | 20ba4fe1bf3d753ecc6f482aeb922582a6b99a1f (diff) | |
download | CMake-0c7029c6420d6387b74a85bb8e62194e80b4e879.zip CMake-0c7029c6420d6387b74a85bb8e62194e80b4e879.tar.gz CMake-0c7029c6420d6387b74a85bb8e62194e80b4e879.tar.bz2 |
Refactor CMake version handling
Move the CMake version number components out of "CMakeLists.txt" into
dedicated file "Source/CMakeVersion.cmake". Set the TWEAK level to the
date explicitly. Add a "Source/CMakeVersion.bash" script to update the
date, thus replacing KWSys DateStamp for CMake. Teach the bootstrap
script to extract the version components from their new location.
Diffstat (limited to 'Source/CMakeVersion.bash')
-rwxr-xr-x | Source/CMakeVersion.bash | 7 |
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" |