Browse Source

Set development flag for Storm version

tempestpy_adaptions
Matthias Volk 7 years ago
parent
commit
7330f1659e
  1. 4
      CMakeLists.txt
  2. 11
      src/storm/utility/storm-version.h
  3. 3
      storm-version.cpp.in

4
CMakeLists.txt

@ -400,10 +400,12 @@ else()
endif() endif()
set(STORM_VERSION_DEV_STRING "") set(STORM_VERSION_DEV_STRING "")
set(STORM_VERSION_DEV "false")
if(STORM_VERSION_COMMITS_AHEAD) if(STORM_VERSION_COMMITS_AHEAD)
MATH(EXPR STORM_VERSION_DEV_PATCH "${STORM_VERSION_PATCH}+1") MATH(EXPR STORM_VERSION_DEV_PATCH "${STORM_VERSION_PATCH}+1")
set(STORM_VERSION_DEV_STRING "(dev)")
set(STORM_VERSION_DEV_STRING " (dev)")
set(STORM_VERSION_DEV "true")
else() else()
set(STORM_VERSION_DEV_PATCH ${STORM_VERSION_PATCH}) set(STORM_VERSION_DEV_PATCH ${STORM_VERSION_PATCH})
endif() endif()

11
src/storm/utility/storm-version.h

@ -18,6 +18,9 @@ namespace storm {
/// The patch version of Storm. /// The patch version of Storm.
const static unsigned versionPatch; const static unsigned versionPatch;
/// Flag indicating if the version of Storm is a development version.
const static bool versionDev;
/// The short hash of the git commit this build is based on /// The short hash of the git commit this build is based on
const static std::string gitRevisionHash; const static std::string gitRevisionHash;
@ -42,12 +45,18 @@ namespace storm {
static std::string shortVersionString() { static std::string shortVersionString() {
std::stringstream sstream; std::stringstream sstream;
sstream << versionMajor << "." << versionMinor << "." << versionPatch; sstream << versionMajor << "." << versionMinor << "." << versionPatch;
if (versionDev) {
sstream << " (dev)";
}
return sstream.str(); return sstream.str();
} }
static std::string longVersionString() { static std::string longVersionString() {
std::stringstream sstream; std::stringstream sstream;
sstream << "Version " << versionMajor << "." << versionMinor << "." << versionPatch; sstream << "Version " << versionMajor << "." << versionMinor << "." << versionPatch;
if (versionDev) {
sstream << " (dev)";
}
if (commitsAhead) { if (commitsAhead) {
sstream << " (+ " << commitsAhead << " commits)"; sstream << " (+ " << commitsAhead << " commits)";
} }
@ -71,7 +80,7 @@ namespace storm {
static std::string buildInfo() { static std::string buildInfo() {
std::stringstream sstream; std::stringstream sstream;
sstream << "Compiled on " << systemName << " " << systemVersion << " using " << cxxCompiler << " with flags '" << cxxFlags << "'"; sstream << "Compiled on " << systemName << " " << systemVersion << " using " << cxxCompiler << " with flags '" << cxxFlags << "'";
return sstream.str();
return sstream.str();
} }
}; };
} }

3
storm-version.cpp.in

@ -7,7 +7,8 @@ namespace storm {
const unsigned StormVersion::versionMajor = @STORM_VERSION_MAJOR@; const unsigned StormVersion::versionMajor = @STORM_VERSION_MAJOR@;
const unsigned StormVersion::versionMinor = @STORM_VERSION_MINOR@; const unsigned StormVersion::versionMinor = @STORM_VERSION_MINOR@;
const unsigned StormVersion::versionPatch = @STORM_VERSION_PATCH@;
const unsigned StormVersion::versionPatch = @STORM_VERSION_DEV_PATCH@;
const bool StormVersion::versionDev = @STORM_VERSION_DEV@;
const std::string StormVersion::gitRevisionHash = "@STORM_VERSION_GIT_HASH@"; const std::string StormVersion::gitRevisionHash = "@STORM_VERSION_GIT_HASH@";
const unsigned StormVersion::commitsAhead = @STORM_VERSION_COMMITS_AHEAD@; const unsigned StormVersion::commitsAhead = @STORM_VERSION_COMMITS_AHEAD@;
const boost::optional<bool> StormVersion::dirty = @STORM_VERSION_DIRTY@; const boost::optional<bool> StormVersion::dirty = @STORM_VERSION_DIRTY@;

Loading…
Cancel
Save