diff --git a/CMakeLists.txt b/CMakeLists.txt index 5831d731f..09eef57a9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -216,6 +216,13 @@ configure_file ( "${PROJECT_SOURCE_DIR}/storm-config.h.in" "${PROJECT_BINARY_DIR}/include/storm-config.h" ) + +# Configure a header file to pass the storm version to the source code +configure_file ( + "${PROJECT_SOURCE_DIR}/storm-version.h.in" + "${PROJECT_BINARY_DIR}/include/storm-version.h" +) + # Add the binary dir include directory for storm-config.h include_directories("${PROJECT_BINARY_DIR}/include") diff --git a/src/storm.cpp b/src/storm.cpp index 81e77cf11..a13bf8e23 100644 --- a/src/storm.cpp +++ b/src/storm.cpp @@ -21,6 +21,7 @@ #include #include "storm-config.h" +#include "storm-version.h" #include "src/models/Dtmc.h" #include "src/models/MarkovAutomaton.h" #include "src/storage/SparseMatrix.h" diff --git a/storm-config.h.in b/storm-config.h.in index 85a33e032..cb90e5af6 100644 --- a/storm-config.h.in +++ b/storm-config.h.in @@ -8,13 +8,6 @@ #ifndef STORM_GENERATED_STORMCONFIG_H_ #define STORM_GENERATED_STORMCONFIG_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 // The path of the sources from which StoRM will be/was build #define STORM_CPP_BASE_PATH "@PROJECT_SOURCE_DIR@" diff --git a/storm-version.h.in b/storm-version.h.in new file mode 100644 index 000000000..5ccac6125 --- /dev/null +++ b/storm-version.h.in @@ -0,0 +1,12 @@ +#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 \ No newline at end of file