summaryrefslogtreecommitdiff
path: root/infrastructure/msvc/getversion.pl
blob: 406501c691dc99f88b432a31a1cdaa0bc0270a59 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!perl

$basedir = $0;
$basedir =~ s/\\[^\\]*$//;
$basedir =~ s/\\[^\\]*$//;
$basedir =~ s/\\[^\\]*$//;
$basedir =~ s/\\[^\\]*$//;
$basedir =~ s/\\[^\\]*$//;
-d $basedir or die "$basedir: $!";
chdir $basedir or die "$basedir: $!";

require "$basedir\\infrastructure\\BoxPlatform.pm.in";

my $newver = "#define BOX_VERSION \"$BoxPlatform::product_version\"\n";

open VERSIONFILE, "< $basedir/lib/common/BoxVersion.h" 
	or die "BoxVersion.h: $!";
my $oldver = <VERSIONFILE>;
close VERSIONFILE;

if ($newver ne $oldver)
{
	open VERSIONFILE, "> $basedir/lib/common/BoxVersion.h" 
		or die "BoxVersion.h: $!";
	print VERSIONFILE "#define BOX_VERSION \"$BoxPlatform::product_version\"\n";
	close VERSIONFILE;
}

exit 0;