From 17a1d02757d2d4e5e6683704e05d3595c0d37a02 Mon Sep 17 00:00:00 2001 From: TimQu Date: Mon, 20 Jul 2020 10:47:35 +0200 Subject: [PATCH] Cmake: Detection for the old in-source "storm-version.cpp" file. The file will now be deleted (if found) to prevent build issues for people that upgraded from older storm versions. --- src/storm/CMakeLists.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/storm/CMakeLists.txt b/src/storm/CMakeLists.txt index dcd1bb9f9..de0a9bd8d 100644 --- a/src/storm/CMakeLists.txt +++ b/src/storm/CMakeLists.txt @@ -1,3 +1,15 @@ +# Storm versions before 1.6.0 generated an in-source .cpp file containing version information. +# When users upgrade from such a version, the generated file will still be there. +# We now delete this file to prevent building issues as there is no corresponding .h file (anymore). +if ((EXISTS "${PROJECT_SOURCE_DIR}/src/storm/utility/storm-version.cpp")) + file(READ "${PROJECT_SOURCE_DIR}/src/storm/utility/storm-version.cpp" STORM_OLD_VERSION_FILE) + string(FIND "${STORM_OLD_VERSION_FILE}" "// AUTO GENERATED -- DO NOT CHANGE" STORM_OLD_VERSION_FILE_DETECTED) + if (STORM_OLD_VERSION_FILE_DETECTED EQUAL 0) + message(WARNING "Storm - The file ${PROJECT_SOURCE_DIR}/src/storm/utility/storm-version.cpp was probably generated by an old Storm version and will be deleted now.") + file(REMOVE "${PROJECT_SOURCE_DIR}/src/storm/utility/storm-version.cpp") + endif(STORM_OLD_VERSION_FILE_DETECTED EQUAL 0) +endif() + file(GLOB_RECURSE ALL_FILES ${PROJECT_SOURCE_DIR}/src/storm/*.h ${PROJECT_SOURCE_DIR}/src/storm/*.cpp) register_source_groups_from_filestructure("${ALL_FILES}" storm)