Elements  6.2
A C++ base framework for the Euclid Software.
Project.h
Go to the documentation of this file.
1 
27 #ifndef ELEMENTSKERNEL_ELEMENTSKERNEL_PROJECT_H_
28 #define ELEMENTSKERNEL_ELEMENTSKERNEL_PROJECT_H_
29 
30 #include <algorithm> // for for_each
31 #include <cstdint> // for uing_least64_t
32 #include <iostream> // for ostream
33 #include <string> // for string
34 #include <vector> // for vector
35 
36 #include "ThisProject.h" // local project constants generated
37  // by the build system
38 
39 namespace Elements {
40 
41 struct Project {
42  static inline std::string name() {
43  return THIS_PROJECT_NAME_STRING;
44  }
45 
46  static inline std::string versionString() {
47  return THIS_PROJECT_VERSION_STRING;
48  }
49  static inline std::uint_least64_t version() {
50  return THIS_PROJECT_VERSION;
51  }
53  return THIS_PROJECT_MAJOR_VERSION;
54  }
56  return THIS_PROJECT_MINOR_VERSION;
57  }
59  return THIS_PROJECT_PATCH_VERSION;
60  }
61  static inline std::string originalVersion() {
62  return THIS_PROJECT_ORIGINAL_VERSION;
63  }
64  static inline std::string vcsVersion() {
65  return THIS_PROJECT_VCS_VERSION;
66  }
67 
68  static inline std::string installLocation() {
69  return THIS_PROJECT_INSTALL_LOCATION_STRING;
70  }
71  static inline bool useSoVersion() {
72  return THIS_PROJECT_USE_SOVERSION;
73  }
74  static inline std::string installPrefix() {
75  return CMAKE_INSTALL_PREFIX_STRING;
76  }
78  return THIS_PROJECT_SEARCH_DIRS;
79  }
80 };
81 
82 inline std::ostream& operator<<(std::ostream& stream, const Project& p) {
83  stream << "Name: " << p.name() << std::endl;
84  stream << "Version String: " << p.versionString() << std::endl;
85  stream << "Version: " << p.version() << std::endl;
86  stream << "Major Version: " << p.majorVersion() << std::endl;
87  stream << "Minor Version: " << p.minorVersion() << std::endl;
88  stream << "Patch Version: " << p.patchVersion() << std::endl;
89  stream << "Original Version: " << p.originalVersion() << std::endl;
90  stream << "VCS Version: " << p.vcsVersion() << std::endl;
91  stream << "Install Location: " << p.installLocation() << std::endl;
92  stream << "Use So Version: " << p.useSoVersion() << std::endl;
93  stream << "Install Prefix: " << p.installPrefix() << std::endl;
94  stream << "Search Directories: ";
95 
96  for (const auto& d : p.searchDirectories()) {
97  stream << d << " ";
98  }
99 
100  return stream;
101 }
102 
103 } // namespace Elements
104 
105 #endif // ELEMENTSKERNEL_ELEMENTSKERNEL_PROJECT_H_
106 
Elements::Project::majorVersion
static std::uint_least64_t majorVersion()
Definition: Project.h:52
std::string
STL class.
Elements::Project::minorVersion
static std::uint_least64_t minorVersion()
Definition: Project.h:55
Elements::Project
Definition: Project.h:41
Elements::Project::patchVersion
static std::uint_least64_t patchVersion()
Definition: Project.h:58
std::vector< std::string >
Elements::Project::searchDirectories
static std::vector< std::string > searchDirectories()
Definition: Project.h:77
Elements::Project::version
static std::uint_least64_t version()
Definition: Project.h:49
Elements::Project::name
static std::string name()
Definition: Project.h:42
Elements::operator<<
ELEMENTS_API std::ostream & operator<<(std::ostream &, const Environment::Variable &)
Definition: Environment.cpp:295
std::ostream
STL class.
std::uint_least64_t
Elements::Project::installLocation
static std::string installLocation()
Definition: Project.h:68
std::endl
T endl(T... args)
Elements::Project::versionString
static std::string versionString()
Definition: Project.h:46
Elements::Project::vcsVersion
static std::string vcsVersion()
Definition: Project.h:64
Elements::Project::installPrefix
static std::string installPrefix()
Definition: Project.h:74
Elements::Project::useSoVersion
static bool useSoVersion()
Definition: Project.h:71
Elements::Project::originalVersion
static std::string originalVersion()
Definition: Project.h:61
Elements
Definition: callBackExample.h:35