]>
git.saurik.com Git - wxWidgets.git/blob - distrib/msw/tmake/lib/wxVersion.pm
9 use wxVersion qw(GetVersion);
18 use vars
qw(@EXPORT_OK);
20 @EXPORT_OK = qw(GetVersion);
24 my $filename = $ENV{"WXWIN"} . "/include/wx/version.h";
25 open(VERSION_H
, $filename) or die "Can't open $filename: $!\n";
30 while ( defined($_ = <VERSION_H
>) ) {
33 if ( /\s*#define\s+wxMAJOR_VERSION\s+(\d+)/ ) {
34 $versions{'MAJOR'} = $1;
37 elsif ( /\s*#define\s+wxMINOR_VERSION\s+(\d+)/ ) {
38 $versions{'MINOR'} = $1;
41 elsif ( /\s*#define\s+wxRELEASE_NUMBER\s+(\d+)/ ) {
42 $versions{'MICRO'} = $1;
46 last if $numGot == 3 # we've got everything we wanted
49 $numGot == 3 or die "Failed to read the version from $filename.\n";
51 # release number if used in the DLL file names only for the unstable branch
52 # as for the stable branches the micro releases are supposed to be
53 # backwards compatible and so should have the same name or otherwise it
54 # would be impossible to use them without recompiling the applications
55 # (which is the whole goal of keeping them backwards compatible in the
58 # and the final piece of the puzzle: stable branches are those with even
59 # minor version number (and unstable -- with odd)
60 $versions{'MICRO_IF_UNSTABLE'} = $versions{'MINOR'} % 2 ? $versions{'MICRO'}