From a528610d985d015f9f0307bc12bd39de17d1c0df Mon Sep 17 00:00:00 2001 From: sjunges Date: Sat, 29 Mar 2014 15:04:32 +0100 Subject: [PATCH] version is now written into a seperate header file to prevent recompile of many files after a commit Former-commit-id: a287aacefa12dbab2516037840b10849fadda34e --- CMakeLists.txt | 7 +++++++ src/storm.cpp | 1 + storm-config.h.in | 7 ------- storm-version.h.in | 12 ++++++++++++ 4 files changed, 20 insertions(+), 7 deletions(-) create mode 100644 storm-version.h.in 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