Elements 6.1.2
A C++ base framework for the Euclid Software.
Loading...
Searching...
No Matches
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
39namespace Elements {
40
41struct 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
82inline 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
T endl(T... args)
ELEMENTS_API std::ostream & operator<<(std::ostream &, const Environment::Variable &)
static std::uint_least64_t minorVersion()
Definition: Project.h:55
static bool useSoVersion()
Definition: Project.h:71
static std::uint_least64_t majorVersion()
Definition: Project.h:52
static std::string originalVersion()
Definition: Project.h:61
static std::string installPrefix()
Definition: Project.h:74
static std::vector< std::string > searchDirectories()
Definition: Project.h:77
static std::uint_least64_t patchVersion()
Definition: Project.h:58
static std::uint_least64_t version()
Definition: Project.h:49
static std::string vcsVersion()
Definition: Project.h:64
static std::string versionString()
Definition: Project.h:46
static std::string installLocation()
Definition: Project.h:68
static std::string name()
Definition: Project.h:42