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