From a91b6d2208fab6a7870ed293e8a5e0319a1ff9fb Mon Sep 17 00:00:00 2001
From: rulrich <ralf.m.ulrich@kit.edu>
Date: Fri, 29 May 2020 14:56:00 +0200
Subject: [PATCH] fixed parameter to shell

---
 CMakeModules/CorsikaUtilities.cmake   | 8 ++++----
 Documentation/Examples/CMakeLists.txt | 8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/CMakeModules/CorsikaUtilities.cmake b/CMakeModules/CorsikaUtilities.cmake
index 62800d907..d80269b3a 100644
--- a/CMakeModules/CorsikaUtilities.cmake
+++ b/CMakeModules/CorsikaUtilities.cmake
@@ -180,7 +180,7 @@ endfunction (CORSIKA_ADD_TEST)
 # target_link_libraries(testSomething ...) and so on.
 #
 function (CORSIKA_ADD_EXAMPLE)
-  cmake_parse_arguments (PARSE_ARGV 1 C8_ADD_EXAMPLE "" "RUN_OPTIONS" "SOURCES")
+  cmake_parse_arguments (PARSE_ARGV 1 C8_ADD_EXAMPLE "" "" "SOURCES;RUN_OPTIONS")
   set (name ${ARGV0})
 
   if (NOT C8_ADD_EXAMPLE_SOURCES)
@@ -207,9 +207,9 @@ function (CORSIKA_ADD_EXAMPLE)
   add_custom_command (TARGET run_examples
     POST_BUILD
     COMMAND ${CMAKE_COMMAND} -E echo ""
-    COMMAND ${CMAKE_COMMAND} -E echo "***************************************"
-    COMMAND ${CMAKE_COMMAND} -E echo "*****   running example: ${name} ${run_options}" 
-    COMMAND ${CMAKE_CURRENT_BINARY_DIR}/${name} ${run_options}
+    COMMAND ${CMAKE_COMMAND} -E echo "**************************************"
+    COMMAND ${CMAKE_COMMAND} -E echo "*****   running example: ${name} " ${run_options} VERBATIM
+    COMMAND ${CMAKE_CURRENT_BINARY_DIR}/${name} ${run_options} VERBATIM
     WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/example_outputs)
   install (TARGETS ${name} DESTINATION share/examples)
 endfunction (CORSIKA_ADD_EXAMPLE)
diff --git a/Documentation/Examples/CMakeLists.txt b/Documentation/Examples/CMakeLists.txt
index b1c2b87de..ee95e2e89 100644
--- a/Documentation/Examples/CMakeLists.txt
+++ b/Documentation/Examples/CMakeLists.txt
@@ -1,11 +1,11 @@
 
-CORSIKA_ADD_EXAMPLE (helix_example SOURCES helix_example.cc)
+CORSIKA_ADD_EXAMPLE (helix_example)
 target_link_libraries (helix_example CORSIKAgeometry CORSIKAunits)
 
-CORSIKA_ADD_EXAMPLE (particle_list_example RUN_OPTIONS aha)
+CORSIKA_ADD_EXAMPLE (particle_list_example)
 target_link_libraries (particle_list_example CORSIKAparticles CORSIKAunits CORSIKAprocesses ProcessSibyll ProcessQGSJetII)
 
-CORSIKA_ADD_EXAMPLE (geometry_example SOURCES geometry_example.cc RUN_OPTIONS test)
+CORSIKA_ADD_EXAMPLE (geometry_example)
 target_link_libraries (geometry_example CORSIKAgeometry CORSIKAunits)
 
 CORSIKA_ADD_EXAMPLE (logger_example)
@@ -82,7 +82,7 @@ if (Pythia8_FOUND)
     CORSIKAprocesssequence
     )
 
-  CORSIKA_ADD_EXAMPLE (vertical_EAS RUN_OPTIONS "4 2 10000.")
+  CORSIKA_ADD_EXAMPLE (vertical_EAS RUN_OPTIONS 4 2 10000.)
   target_link_libraries (vertical_EAS
     SuperStupidStack
     CORSIKAunits
-- 
GitLab