summaryrefslogtreecommitdiff
path: root/make-version.pl
diff options
context:
space:
mode:
Diffstat (limited to 'make-version.pl')
-rwxr-xr-xmake-version.pl5
1 files changed, 4 insertions, 1 deletions
diff --git a/make-version.pl b/make-version.pl
index 53d3094364..00452c5856 100755
--- a/make-version.pl
+++ b/make-version.pl
@@ -380,6 +380,7 @@ Fin
# Read CMakeLists.txt, then write it back out with updated "set(PROJECT_..._VERSION ...)
# lines
+# set(GIT_REVISION 999)
# set(PROJECT_MAJOR_VERSION 1)
# set(PROJECT_MINOR_VERSION 99)
# set(PROJECT_PATCH_VERSION 0)
@@ -398,7 +399,9 @@ sub update_cmakelists_txt
open(CFGIN, "< $filepath") || die "Can't read $filepath!";
while ($line = <CFGIN>) {
- if ($line =~ /^set *\( *PROJECT_MAJOR_VERSION .*([\r\n]+)$/) {
+ if ($line =~ /^set *\( *GIT_REVISION .*([\r\n]+)$/) {
+ $line = sprintf("set(GIT_REVISION %d)$1", $num_commits);
+ } elsif ($line =~ /^set *\( *PROJECT_MAJOR_VERSION .*([\r\n]+)$/) {
$line = sprintf("set(PROJECT_MAJOR_VERSION %d)$1", $version_pref{"version_major"});
} elsif ($line =~ /^set *\( *PROJECT_MINOR_VERSION .*([\r\n]+)$/) {
$line = sprintf("set(PROJECT_MINOR_VERSION %d)$1", $version_pref{"version_minor"});