commonlib/version.cpp

Mon, 06 Dec 2021 00:29:47 +0200

author
Teemu Piippo <teemu@hecknology.net>
date
Mon, 06 Dec 2021 00:29:47 +0200
changeset 67
c34057d3c94e
parent 57
3003661011d2
permissions
-rw-r--r--

Fix build on Windows

44
d0bf58f3560f Split the project into two executables (the launcher and the configurator)
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
1 /*
d0bf58f3560f Split the project into two executables (the launcher and the configurator)
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
2 * ZCinema: Zandronum demo launcher
d0bf58f3560f Split the project into two executables (the launcher and the configurator)
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
3 * Copyright (C) 2013-2015 Teemu Piippo
d0bf58f3560f Split the project into two executables (the launcher and the configurator)
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
4 *
d0bf58f3560f Split the project into two executables (the launcher and the configurator)
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
5 * This program is free software: you can redistribute it and/or modify
d0bf58f3560f Split the project into two executables (the launcher and the configurator)
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
6 * it under the terms of the GNU General Public License as published by
d0bf58f3560f Split the project into two executables (the launcher and the configurator)
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
7 * the Free Software Foundation, either version 3 of the License, or
d0bf58f3560f Split the project into two executables (the launcher and the configurator)
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
8 * (at your option) any later version.
d0bf58f3560f Split the project into two executables (the launcher and the configurator)
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
9 *
d0bf58f3560f Split the project into two executables (the launcher and the configurator)
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
10 * This program is distributed in the hope that it will be useful,
d0bf58f3560f Split the project into two executables (the launcher and the configurator)
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
d0bf58f3560f Split the project into two executables (the launcher and the configurator)
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
d0bf58f3560f Split the project into two executables (the launcher and the configurator)
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
13 * GNU General Public License for more details.
d0bf58f3560f Split the project into two executables (the launcher and the configurator)
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
14 *
d0bf58f3560f Split the project into two executables (the launcher and the configurator)
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License
d0bf58f3560f Split the project into two executables (the launcher and the configurator)
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
d0bf58f3560f Split the project into two executables (the launcher and the configurator)
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
17 */
d0bf58f3560f Split the project into two executables (the launcher and the configurator)
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
18
d0bf58f3560f Split the project into two executables (the launcher and the configurator)
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
19 #include "version.h"
d0bf58f3560f Split the project into two executables (the launcher and the configurator)
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
20 #include "hginfo.h"
d0bf58f3560f Split the project into two executables (the launcher and the configurator)
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
21
d0bf58f3560f Split the project into two executables (the launcher and the configurator)
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
22 //
d0bf58f3560f Split the project into two executables (the launcher and the configurator)
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
23 // -------------------------------------------------------------------------------------------------
d0bf58f3560f Split the project into two executables (the launcher and the configurator)
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
24 //
d0bf58f3560f Split the project into two executables (the launcher and the configurator)
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
25
d0bf58f3560f Split the project into two executables (the launcher and the configurator)
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
26 QString versionString()
d0bf58f3560f Split the project into two executables (the launcher and the configurator)
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
27 {
d0bf58f3560f Split the project into two executables (the launcher and the configurator)
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
28 #ifndef RELEASE
d0bf58f3560f Split the project into two executables (the launcher and the configurator)
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
29 # ifdef HG_NODE
d0bf58f3560f Split the project into two executables (the launcher and the configurator)
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
30 // non-release with hg info
d0bf58f3560f Split the project into two executables (the launcher and the configurator)
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
31 return VERSION_STRING "-" HG_NODE;
d0bf58f3560f Split the project into two executables (the launcher and the configurator)
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
32 # else
d0bf58f3560f Split the project into two executables (the launcher and the configurator)
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
33 // non-release, no hg info
d0bf58f3560f Split the project into two executables (the launcher and the configurator)
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
34 return VERSION_STRING "-beta";
d0bf58f3560f Split the project into two executables (the launcher and the configurator)
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
35 # endif
d0bf58f3560f Split the project into two executables (the launcher and the configurator)
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
36 #else
d0bf58f3560f Split the project into two executables (the launcher and the configurator)
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
37 // release
d0bf58f3560f Split the project into two executables (the launcher and the configurator)
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
38 return VERSION_STRING;
d0bf58f3560f Split the project into two executables (the launcher and the configurator)
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
39 #endif
d0bf58f3560f Split the project into two executables (the launcher and the configurator)
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
40 }
d0bf58f3560f Split the project into two executables (the launcher and the configurator)
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
41
d0bf58f3560f Split the project into two executables (the launcher and the configurator)
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
42 //
d0bf58f3560f Split the project into two executables (the launcher and the configurator)
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
43 // -------------------------------------------------------------------------------------------------
d0bf58f3560f Split the project into two executables (the launcher and the configurator)
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
44 //
d0bf58f3560f Split the project into two executables (the launcher and the configurator)
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
45
d0bf58f3560f Split the project into two executables (the launcher and the configurator)
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
46 QString versionSignature()
d0bf58f3560f Split the project into two executables (the launcher and the configurator)
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
47 {
57
3003661011d2 Only include date in full version signature if not in a release
Teemu Piippo <crimsondusk64@gmail.com>
parents: 46
diff changeset
48 #if defined (HG_DATE_STRING) && !defined (RELEASE)
44
d0bf58f3560f Split the project into two executables (the launcher and the configurator)
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
49 # define DATE_INFO " (" HG_DATE_STRING ")"
d0bf58f3560f Split the project into two executables (the launcher and the configurator)
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
50 #else
d0bf58f3560f Split the project into two executables (the launcher and the configurator)
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
51 # define DATE_INFO ""
d0bf58f3560f Split the project into two executables (the launcher and the configurator)
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
52 #endif
d0bf58f3560f Split the project into two executables (the launcher and the configurator)
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
53
d0bf58f3560f Split the project into two executables (the launcher and the configurator)
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
54 return QString (APPNAME) + " " + versionString() + DATE_INFO;
57
3003661011d2 Only include date in full version signature if not in a release
Teemu Piippo <crimsondusk64@gmail.com>
parents: 46
diff changeset
55 }

mercurial