src/main.cpp

Tue, 16 Jul 2013 23:53:31 +0300

author
Teemu Piippo <crimsondusk64@gmail.com>
date
Tue, 16 Jul 2013 23:53:31 +0300
changeset 0
bb264814dd81
child 1
c9b22c06307c
permissions
-rw-r--r--

Initial commit

0
bb264814dd81 Initial commit
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
1 #include "types.h"
bb264814dd81 Initial commit
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
2
bb264814dd81 Initial commit
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
3 int main() {
bb264814dd81 Initial commit
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
4 print ("Hello world! This is " APPNAME " %1\n", versionString() );
bb264814dd81 Initial commit
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
5 }
bb264814dd81 Initial commit
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
6
bb264814dd81 Initial commit
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
7 QString versionString() {
bb264814dd81 Initial commit
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
8 str text = fmt( "v%1.%2", VERSION_MAJOR, VERSION_MINOR );
bb264814dd81 Initial commit
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
9 #if VERSION_PATCH != 0
bb264814dd81 Initial commit
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
10 text += fmt( ".%3", VERSION_PATCH );
bb264814dd81 Initial commit
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
11 #endif
bb264814dd81 Initial commit
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
12
bb264814dd81 Initial commit
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
13 #if BUILD_ID == BUILD_INTERNAL
bb264814dd81 Initial commit
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
14 text += "-intern";
bb264814dd81 Initial commit
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
15 #elif BUILD_ID == BUILD_ALPHA
bb264814dd81 Initial commit
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
16 text += "-alpha";
bb264814dd81 Initial commit
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
17 #elif BUILD_ID == BUILD_BETA
bb264814dd81 Initial commit
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
18 text += "-beta";
bb264814dd81 Initial commit
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
19 #elif BUILD_ID == BUILD_RC
bb264814dd81 Initial commit
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
20 text += fmt( "-rc%1", RC_ID );
bb264814dd81 Initial commit
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
21 #elif BUILD_ID == BUILD_RELEASE
bb264814dd81 Initial commit
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
22 text += "-rel";
bb264814dd81 Initial commit
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
23 #else
bb264814dd81 Initial commit
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
24 # error Invalid build code!
bb264814dd81 Initial commit
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
25 #endif // BUILD_ID
bb264814dd81 Initial commit
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
26
bb264814dd81 Initial commit
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
27 return text;
bb264814dd81 Initial commit
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
28 }

mercurial