Rev 1221 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1 | |||
1183 | werner | 2 | /******************************************************************************************** |
3 | ** iLand - an individual based forest landscape and disturbance model |
||
4 | ** http://iland.boku.ac.at |
||
5 | ** Copyright (C) 2009- Werner Rammer, Rupert Seidl |
||
6 | ** |
||
7 | ** This program is free software: you can redistribute it and/or modify |
||
8 | ** it under the terms of the GNU General Public License as published by |
||
9 | ** the Free Software Foundation, either version 3 of the License, or |
||
10 | ** (at your option) any later version. |
||
11 | ** |
||
12 | ** This program is distributed in the hope that it will be useful, |
||
13 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
14 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||
15 | ** GNU General Public License for more details. |
||
16 | ** |
||
17 | ** You should have received a copy of the GNU General Public License |
||
18 | ** along with this program. If not, see <http://www.gnu.org/licenses/>. |
||
19 | ********************************************************************************************/ |
||
20 | |||
21 | |||
22 | #include <QString> |
||
1213 | werner | 23 | static const char *version = "1.0"; |
1219 | werner | 24 | static const char *svn_revision = "1220"; |
1183 | werner | 25 | const char *currentVersion(){ return version;} |
26 | const char *svnRevision(){ return svn_revision;} |
||
27 | |||
28 | // compiler version |
||
29 | #ifdef Q_CC_MSVC |
||
30 | #define MYCC "MSVC" |
||
31 | #endif |
||
32 | #ifdef Q_CC_GNU |
||
33 | #define MYCC "GCC" |
||
34 | #endif |
||
35 | #ifdef Q_CC_INTEL |
||
36 | #define MYCC "Intel" |
||
37 | #endif |
||
38 | #ifndef MYCC |
||
39 | #define MYCC "unknown" |
||
40 | #endif |
||
41 | |||
42 | // http://stackoverflow.com/questions/1505582/determining-32-vs-64-bit-in-c |
||
43 | // Check windows |
||
44 | #if _WIN32 || _WIN64 |
||
45 | #if _WIN64 |
||
46 | #define ENVIRONMENT64 |
||
47 | #else |
||
48 | #define ENVIRONMENT32 |
||
49 | #endif |
||
50 | #endif |
||
51 | |||
52 | // Check GCC |
||
53 | #if __GNUC__ |
||
54 | #if __x86_64__ || __ppc64__ |
||
55 | #define ENVIRONMENT64 |
||
56 | #else |
||
57 | #define ENVIRONMENT32 |
||
58 | #endif |
||
59 | #endif |
||
60 | |||
61 | #ifdef ENVIRONMENT32 |
||
62 | #define BITS "32 bit" |
||
63 | #else |
||
64 | #define BITS "64 bit" |
||
65 | #endif |
||
66 | |||
67 | |||
68 | QString compiler() |
||
69 | { |
||
70 | return QString("%1 %2 Qt %3").arg(MYCC).arg(BITS).arg(qVersion()); |
||
71 | } |
||
72 | |||
73 | QString verboseVersion() |
||
74 | { |
||
75 | const char *bd = __DATE__; // build date |
||
76 | QString s = QString("%1 (svn: %2, %3, %4)").arg(currentVersion()).arg(svnRevision()).arg(bd).arg(qVersion()); |
||
77 | return s; |
||
78 | } |