All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
version.hh
1 // -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 // vi: set et ts=4 sw=4 sts=4:
3 /*
4  This file is part of the Open Porous Media project (OPM).
5 
6  OPM is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 2 of the License, or
9  (at your option) any later version.
10 
11  OPM is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with OPM. If not, see <http://www.gnu.org/licenses/>.
18 
19  Consult the COPYING file in the top-level source directory of this
20  module for the precise wording of the license and the list of
21  copyright holders.
22 */
23 #ifndef EWOMS_VERSION_HH
24 #define EWOMS_VERSION_HH
25 
26 #define EWOMS_VERSION_MAJOR 2017
27 #define EWOMS_VERSION_MINOR 10
28 #define EWOMS_VERSION_REVISION -1 // -1 means that this is a version from the development branch...
29 
30 #define EWOMS_VERSION_SUFFIX "pre"
31 #define EWOMS_VERSION_CODENAME "Buddy Holly"
32 
33 #include <string>
34 #include <sstream>
35 #include <iomanip>
36 
37 namespace Ewoms {
38 
39 inline std::string versionString()
40 {
41  std::ostringstream oss;
42  oss << EWOMS_VERSION_MAJOR << "."
43  << std::setfill('0') << std::setw(2) << EWOMS_VERSION_MINOR;
44 
45  if (EWOMS_VERSION_REVISION > 0)
46  oss << "." << EWOMS_VERSION_REVISION;
47 
48  // append the version suffix to the version string
49 #ifdef EWOMS_VERSION_SUFFIX
50  oss << "-" << EWOMS_VERSION_SUFFIX;
51 #endif
52 
53  // append the code name to the version string
54 #ifdef EWOMS_VERSION_CODENAME
55  oss << " (\"" << EWOMS_VERSION_CODENAME "\")";
56 #endif
57 
58  return oss.str();
59 }
60 
61 } // namespace Ewoms
62 
63 #endif // EWOMS_VERSION_HH