///////////////////////////////////////////////////////////////////// /// \file Version.hh /// \brief Access the current RAT version and revision. /// /// \author A. Mastbaum /// /// Getters for the current RAT version and revision, according to /// git. scons writes the corresponding source files that actually /// contain the strings. With this arrangement, changing the version /// means recompiling that one target, not everywhere the version is /// used. ///////////////////////////////////////////////////////////////////// #ifndef __RAT_Version__ #define __RAT_Version__ #include namespace RAT { /// These are defined in src/core/Version.cc, which is written by scons /// as part of the build process. extern const std::string RATVERSION; extern const std::string RATREVISION; /// Get the RAT version. /// /// The version is a string containing the tag name. If this is not a tagged /// release, the format is tagname-N-gSHA, where N is the number of commits /// since tagname and SHA is an abbreviated version of the current revision /// ID. This comes from `git describe --always --tag`. inline const std::string GetRATVersion() { return RATVERSION; } /// Get the RAT revision. /// /// This is the full SHA for the current commit, which comes from /// `git log -1 --format="%H"` inline const std::string GetRATRevision() { return RATREVISION; } } // namespace RAT #endif // __RAT_Version__