From e0f6c3dfddae5ee081eefecd131400ff1fa622a2 Mon Sep 17 00:00:00 2001 From: ralfulrich <ralf.ulrich@kit.edu> Date: Tue, 2 Mar 2021 21:32:55 +0100 Subject: [PATCH] WITH_HISTORY option had to move from framework (header-only) to user/application-code. --- CMakeLists.txt | 10 ---------- cmake/corsikaConfig.cmake.in | 24 ++++++++++++++++++++++++ corsika/setup/SetupStack.hpp | 11 +++++++---- 3 files changed, 31 insertions(+), 14 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4f18d46bf..b2025647e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -193,12 +193,6 @@ if (NOT DEFINED ENV{CI}) add_test (NAME copyright_notices COMMAND ./do-copyright.py WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) endif (NOT DEFINED ENV{CI}) -#+++++++++++++++++++++++++++++ -# Options -# -# HISTORY option selection -option (WITH_HISTORY "Flag to switch on/off HISTORY" ON) - #+++++++++++++++++++++++++++++ # Externals # @@ -346,13 +340,9 @@ install (DIRECTORY examples DESTINATION share/corsika) add_subdirectory (tools) - - - #+++++++++++++++++++++++++++++++ # # final summary output # include (FeatureSummary) -add_feature_info (HISTORY WITH_HISTORY "Full information on cascade history for particles.") feature_summary (WHAT ALL) diff --git a/cmake/corsikaConfig.cmake.in b/cmake/corsikaConfig.cmake.in index 4bf1338b2..5aadf213c 100644 --- a/cmake/corsikaConfig.cmake.in +++ b/cmake/corsikaConfig.cmake.in @@ -2,6 +2,12 @@ set (CORSIKA8_VERSION @c8_version@) @PACKAGE_INIT@ +#+++++++++++++++++++++++++++ +# Options +# +option (WITH_HISTORY "Flag to switch on/off HISTORY" ON) + + #++++++++++++++++++++++++++++ # General config and flags # @@ -37,3 +43,21 @@ message (STATUS "Pythia8 at: @Pythia8_PREFIX@") # include ("${CMAKE_CURRENT_LIST_DIR}/corsikaTargets.cmake") check_required_components (corsika) + + +#+++++++++++++++++++++++++++++++ +# add further definitions / options +# +if (WITH_HISTORY) + target_compile_definitions (CORSIKA8::CORSIKA8 INTERFACE "WITH_HISTORY") +endif (WITH_HISTORY) + + + +#+++++++++++++++++++++++++++++++ +# +# final summary output +# +include (FeatureSummary) +add_feature_info (HISTORY WITH_HISTORY "Full information on cascade history for particles.") +feature_summary (WHAT ALL) diff --git a/corsika/setup/SetupStack.hpp b/corsika/setup/SetupStack.hpp index 6c9696d89..44c0cd4a1 100644 --- a/corsika/setup/SetupStack.hpp +++ b/corsika/setup/SetupStack.hpp @@ -18,12 +18,15 @@ namespace corsika::setup { #ifdef WITH_HISTORY + #include <corsika/stack/history/HistoryStackExtension.hpp> + #include <corsika/stack/history/HistorySecondaryProducer.hpp> + /* * the version with history */ using Stack = detail::StackWithHistory; template <typename T1, template <typename> typename M2> - using StackViewProducer = HistorySecondaryProducer<T1, M2>; + using StackViewProducer = history::HistorySecondaryProducer<T1, M2>; #else // WITH_HISTORY @@ -32,7 +35,7 @@ namespace corsika::setup { */ using Stack = detail::StackWithGeometry; template <typename T1, template <typename> typename M2> - using StackViewProducer = corsika::DefaultSecondaryProducer<T1, M2>; + using StackViewProducer = DefaultSecondaryProducer<T1, M2>; #endif @@ -58,7 +61,7 @@ namespace corsika::setup { // CHECK with CLANG: setup::Stack::MPIType>; detail::StackWithHistoryInterface, StackViewProducer>; #elif defined(__GNUC__) || defined(__GNUG__) - using StackView = make_view<setup::Stack, StackViewProducer>::type; + using StackView = MakeView<setup::Stack, StackViewProducer>::type; #endif #else // WITH_HISTORY @@ -69,7 +72,7 @@ namespace corsika::setup { // setup::Stack::MPIType>; setup::detail::StackWithGeometryInterface>; #elif defined(__GNUC__) || defined(__GNUG__) - using StackView = corsika::MakeView<setup::Stack>::type; + using StackView = MakeView<setup::Stack>::type; #endif #endif // WITH_HISTORY -- GitLab