From 8c73d28ff25b521bda80d85f0f2cc76a2c905c47 Mon Sep 17 00:00:00 2001
From: Remy Prechelt <rprechelt@gmail.com>
Date: Thu, 21 May 2020 23:16:34 -1000
Subject: [PATCH] Ensure vertical_EAS is only built if Pythia is available.

The `vertical_EAS` example requires Pythia however the build process
still tried to compile the example code even when Pythia was
unavailable. This adds an explicit dependence on Pythia for the
vertical air shower example.
---
 Documentation/Examples/CMakeLists.txt | 54 +++++++++++++--------------
 1 file changed, 27 insertions(+), 27 deletions(-)

diff --git a/Documentation/Examples/CMakeLists.txt b/Documentation/Examples/CMakeLists.txt
index 936e54ed2..474bbe422 100644
--- a/Documentation/Examples/CMakeLists.txt
+++ b/Documentation/Examples/CMakeLists.txt
@@ -85,33 +85,34 @@ if (Pythia8_FOUND)
     CORSIKAprocesssequence
     )
   install (TARGETS cascade_proton_example DESTINATION share/examples)
-endif()
 
-add_executable(vertical_EAS vertical_EAS.cc)
-target_link_libraries (vertical_EAS
-  SuperStupidStack
-  CORSIKAunits
-  CORSIKAlogging
-  CORSIKArandom
-  ProcessSibyll
-  ProcessPythia
-  ProcessUrQMD
-  ProcessSwitch
-  CORSIKAcascade
-  ProcessEnergyLoss
-  ProcessObservationPlane
-  ProcessTrackingLine
-  ProcessParticleCut
-  ProcessStackInspector
-  ProcessInteractionCounter
-  CORSIKAprocesses
-  CORSIKAcascade
-  CORSIKAparticles
-  CORSIKAgeometry
-  CORSIKAenvironment
-  CORSIKAprocesssequence
-  )
-install (TARGETS vertical_EAS DESTINATION share/examples)
+  add_executable(vertical_EAS vertical_EAS.cc)
+  target_link_libraries (vertical_EAS
+    SuperStupidStack
+    CORSIKAunits
+    CORSIKAlogging
+    CORSIKArandom
+    ProcessSibyll
+    ProcessPythia
+    ProcessUrQMD
+    ProcessSwitch
+    CORSIKAcascade
+    ProcessEnergyLoss
+    ProcessObservationPlane
+    ProcessTrackingLine
+    ProcessParticleCut
+    ProcessStackInspector
+    ProcessInteractionCounter
+    CORSIKAprocesses
+    CORSIKAcascade
+    CORSIKAparticles
+    CORSIKAgeometry
+    CORSIKAenvironment
+    CORSIKAprocesssequence
+    )
+  install (TARGETS vertical_EAS DESTINATION share/examples)
+  
+endif()
 
 CORSIKA_ADD_TEST(stopping_power)
 target_link_libraries (stopping_power
@@ -123,7 +124,6 @@ target_link_libraries (stopping_power
   CORSIKAenvironment
   )
 
-install (TARGETS vertical_EAS DESTINATION share/examples)
 CORSIKA_ADD_TEST (staticsequence_example)
 target_link_libraries (staticsequence_example
   CORSIKAprocesssequence
-- 
GitLab