From 1343ae5c19e731573568dd6a3cfcbd06b722f9b5 Mon Sep 17 00:00:00 2001 From: TimQu Date: Wed, 15 Jul 2020 09:53:54 +0200 Subject: [PATCH] Fixed 'boost/optional.hpp file not found' error in storm-version library (simply by not using boost). --- CMakeLists.txt | 6 +++--- src/storm-version-info/storm-version.cpp.in | 2 +- src/storm-version-info/storm-version.h | 24 ++++++++++----------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4847f91c0..751e5a7e0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -439,15 +439,15 @@ set(STORM_VERSION_APPENDIX "${CMAKE_MATCH_5}") # might be empty if (STORM_GIT_VERSION_STRING MATCHES "NOTFOUND") set(STORM_VERSION_SOURCE "VersionSource::Static") set(STORM_VERSION_COMMITS_AHEAD 0) - set(STORM_VERSION_DIRTY boost::none) + set(STORM_VERSION_DIRTY DirtyState:Unknown) include(version.cmake) message(WARNING "Storm - Git version information not available, statically assuming version ${STORM_VERSION_MAJOR}.${STORM_VERSION_MINOR}.${STORM_VERSION_PATCH}.") else() set(STORM_VERSION_SOURCE "VersionSource::Git") if ("${STORM_VERSION_APPENDIX}" MATCHES "^.*dirty.*$") - set(STORM_VERSION_DIRTY "true") + set(STORM_VERSION_DIRTY "DirtyState::Dirty") else() - set(STORM_VERSION_DIRTY "false") + set(STORM_VERSION_DIRTY "DirtyState::Clean") endif() endif() diff --git a/src/storm-version-info/storm-version.cpp.in b/src/storm-version-info/storm-version.cpp.in index dea052831..c63deab0f 100644 --- a/src/storm-version-info/storm-version.cpp.in +++ b/src/storm-version-info/storm-version.cpp.in @@ -11,7 +11,7 @@ namespace storm { const StormVersion::VersionSource StormVersion::versionSource = @STORM_VERSION_SOURCE@; const std::string StormVersion::gitRevisionHash = "@STORM_VERSION_GIT_HASH@"; const unsigned StormVersion::commitsAhead = @STORM_VERSION_COMMITS_AHEAD@; - const boost::optional StormVersion::dirty = @STORM_VERSION_DIRTY@; + const StormVersion::DirtyState StormVersion::dirty = @STORM_VERSION_DIRTY@; const std::string StormVersion::systemName = "@CMAKE_SYSTEM_NAME@"; const std::string StormVersion::systemVersion = "@CMAKE_SYSTEM_VERSION@"; const std::string StormVersion::cxxCompiler = "@STORM_COMPILER_ID@ @CMAKE_CXX_COMPILER_VERSION@"; diff --git a/src/storm-version-info/storm-version.h b/src/storm-version-info/storm-version.h index 297361fbb..5f07d5a22 100644 --- a/src/storm-version-info/storm-version.h +++ b/src/storm-version-info/storm-version.h @@ -3,8 +3,6 @@ #include #include -#include - namespace storm { struct StormVersion { @@ -36,8 +34,14 @@ namespace storm { /// How many commits passed since the tag was last set. const static unsigned commitsAhead; - /// 0 iff there no files were modified in the checkout, 1 otherwise. If none, no information about dirtyness is given. - const static boost::optional dirty; + enum class DirtyState { + Clean, /// no files were modified in the checkout + Dirty, /// some files were modified + Unknown /// No information about dirtyness is given. + }; + + /// Indicates whether files were modified + const static DirtyState dirty; /// The system which has compiled Storm. const static std::string systemName; @@ -77,14 +81,10 @@ namespace storm { } else { sstream << " built from archive"; } - if (dirty) { - if (dirty.get()) { - sstream << " (dirty)"; - } else { - sstream << " (clean)"; - } - } else { - sstream << " (potentially dirty)"; + switch (dirty) { + case DirtyState::Clean: sstream << " (clean)"; break; + case DirtyState::Dirty: sstream << " (dirty)"; break; + default: sstream << " (potentially dirty)"; break; } return sstream.str(); }