9 changed files with 139 additions and 29 deletions
			
			
		- 
					15CMakeLists.txt
- 
					6src/settings/SettingsManager.cpp
- 
					5src/settings/SettingsManager.h
- 
					6src/settings/modules/GeneralSettings.cpp
- 
					9src/settings/modules/GeneralSettings.h
- 
					17src/utility/cli.h
- 
					66src/utility/storm-version.h
- 
					28storm-version.cpp.in
- 
					12storm-version.h.in
| @ -0,0 +1,66 @@ | |||
| /**  | |||
|  * @file:   storm-version.h | |||
|  * @author: Sebastian Junges | |||
|  * | |||
|  * @since October 7, 2014 | |||
|  */ | |||
| 
 | |||
| #pragma once | |||
| #include <string> | |||
| #include <sstream> | |||
| 
 | |||
| namespace storm  | |||
| { | |||
| 	namespace utility { | |||
| 	struct StormVersion  | |||
| 	{ | |||
| 		/// The major version of StoRM | |||
| 		const static unsigned versionMajor; | |||
| 		/// The minor version of StoRM | |||
| 		const static unsigned versionMinor; | |||
| 		/// The patch version of StoRM | |||
| 		const static unsigned versionPatch; | |||
| 		/// The short hash of the git commit this build is bases on | |||
| 		const static std::string gitRevisionHash; | |||
| 		/// 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 else | |||
| 		const static unsigned dirty; | |||
| 		/// The system which has compiled storm | |||
| 		const static std::string systemName; | |||
| 		/// The system version which has compiled storm | |||
| 		const static std::string systemVersion; | |||
| 		/// The build type that was used to build storm | |||
| 		const static std::string buildType; | |||
| 		/// The compiler version that was used to build storm | |||
| 		const static std::string cxxCompiler; | |||
| 		 | |||
| 		static std::string shortVersionString() { | |||
| 			std::stringstream sstream; | |||
| 			sstream << "StoRM " << versionMajor << "." << versionMinor << "." << versionPatch; | |||
| 			return sstream.str(); | |||
| 		} | |||
| 		 | |||
| 		static std::string longVersionString() { | |||
| 			std::stringstream sstream; | |||
| 			sstream << "Version: " << versionMajor << "." <<  versionMinor << "." << versionPatch; | |||
| 			if (commitsAhead != 0) { | |||
| 				sstream << " (+" << commitsAhead << " commits)"; | |||
| 			} | |||
| 			sstream << " build from revision " << gitRevisionHash; | |||
| 			if (dirty == 1) { | |||
| 				sstream << " (DIRTY)"; | |||
| 			} | |||
| 			sstream << "." << std::endl; | |||
| 			return sstream.str(); | |||
| 		} | |||
| 		 | |||
| 		static std::string buildInfo() { | |||
| 			std::stringstream sstream; | |||
| 			sstream << "Compiled on " << systemName << " " << systemVersion << ","; | |||
| 			sstream << "using " << cxxCompiler << " with " << buildType << " flags."; | |||
| 			return sstream.str();	 | |||
| 		} | |||
| 	}; | |||
| 	} | |||
| } | |||
| @ -0,0 +1,28 @@ | |||
| #include "src/utility/storm-version.h" | |||
| 
 | |||
| namespace storm | |||
| { | |||
| namespace utility | |||
| { | |||
| // The major version of StoRM | |||
| const unsigned StormVersion::versionMajor = @STORM_CPP_VERSION_MAJOR@;					 | |||
| // The minor version of StoRM | |||
| const unsigned StormVersion::versionMinor = @STORM_CPP_VERSION_MINOR@; | |||
| // The patch version of StoRM | |||
| const unsigned StormVersion::versionPatch = @STORM_CPP_VERSION_PATCH@; | |||
| // The short hash of the git commit this build is bases on | |||
| const std::string StormVersion::gitRevisionHash = "@STORM_CPP_VERSION_HASH@"; | |||
| // How many commits passed since the tag was last set | |||
| const unsigned StormVersion::commitsAhead = @STORM_CPP_VERSION_COMMITS_AHEAD@; 	 | |||
| // 0 iff there no files were modified in the checkout, 1 else | |||
| const unsigned StormVersion::dirty = @STORM_CPP_VERSION_DIRTY@; 					 | |||
| // The system which has compiled storm | |||
| const std::string StormVersion::systemName = "@CMAKE_SYSTEM_NAME@"; | |||
| // The system version which has compiled storm | |||
| const std::string StormVersion::systemVersion = "@CMAKE_SYSTEM_VERSION@"; | |||
| // The build type that was used to build storm | |||
| const std::string StormVersion::buildType = "@CMAKE_BUILD_TYPE@"; | |||
| // The compiler version that was used to build storm | |||
| const std::string StormVersion::cxxCompiler = "@STORM_COMPILED_BY@ @CMAKE_CXX_COMPILER_VERSION@"; | |||
| } | |||
| } | |||
| @ -1,12 +0,0 @@ | |||
| #ifndef STORM_GENERATED_VERSION_H_ | |||
| #define STORM_GENERATED_VERSION_H_ | |||
| 
 | |||
| // Version Information | |||
| #define STORM_CPP_VERSION_MAJOR @STORM_CPP_VERSION_MAJOR@					// The major version of StoRM | |||
| #define STORM_CPP_VERSION_MINOR @STORM_CPP_VERSION_MINOR@					// The minor version of StoRM | |||
| #define STORM_CPP_VERSION_PATCH @STORM_CPP_VERSION_PATCH@					// The patch version of StoRM | |||
| #define STORM_CPP_VERSION_COMMITS_AHEAD @STORM_CPP_VERSION_COMMITS_AHEAD@ 	// How many commits passed since the tag was last set | |||
| #define STORM_CPP_VERSION_HASH "@STORM_CPP_VERSION_HASH@" 					// The short hash of the git commit this build is bases on | |||
| #define STORM_CPP_VERSION_DIRTY @STORM_CPP_VERSION_DIRTY@ 					// 0 iff there no files were modified in the checkout, 1 else | |||
| 
 | |||
| #endif | |||
						Write
						Preview
					
					
					Loading…
					
					Cancel
						Save
					
		Reference in new issue