-
Notifications
You must be signed in to change notification settings - Fork 499
Expand file tree
/
Copy pathO2SimulationDependencies.cmake
More file actions
99 lines (84 loc) · 3.29 KB
/
O2SimulationDependencies.cmake
File metadata and controls
99 lines (84 loc) · 3.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# Copyright 2019-2020 CERN and copyright holders of ALICE O2.
# See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
# All rights not expressly granted are reserved.
#
# This software is distributed under the terms of the GNU General Public
# License v3 (GPL Version 3), copied verbatim in the file "COPYING".
#
# In applying this license CERN does not waive the privileges and immunities
# granted to it by virtue of its status as an Intergovernmental Organization
# or submit itself to any jurisdiction.
#
# Note that the BUILD_SIMULATION option governs what to do with the simulation
# parts of the repository, depending on whether or not the MC simulation
# packages (pythia, geant, etc...) needed for those parts are available or not.
#
# If BUILD_SIMULATION is specified on the command line (using -D), or set in the
# cache, then it is a hard requirement :
#
# * BUILD_SIMULATION=ON and MCpackages found => BUILD_SIMULATION=ON
# * BUILD_SIMULATION=ON and MCpackages not found => FAILURE
# * BUILD_SIMULATION=OFF => BUILD_SIMULATION=OFF (regardless of MCpackages found
# or not)
#
# If on the other hand BUILD_SIMULATION is NOT specified on the command line
# then simulation is built if MCpackages are available and the default value for
# build simulation is set to ON
#
# * MCpackages found => BUILD_SIMULATION=BUILD_SIMULATION_DEFAULT
# * MCpackages not found => BUILD_SIMULATION=OFF
#
include_guard()
set(mcPackageRequirement OPTIONAL)
if(DEFINED BUILD_SIMULATION AND BUILD_SIMULATION)
set(mcPackageRequirement REQUIRED)
endif()
# MC specific packages
find_package(pythia MODULE)
set_package_properties(pythia
PROPERTIES
TYPE ${mcPackageRequirement} DESCRIPTION
"the Pythia8 generator")
find_package(Geant3 MODULE)
set_package_properties(Geant3
PROPERTIES
TYPE ${mcPackageRequirement} DESCRIPTION
"the legacy but not slow MC transport engine")
find_package(Geant4 MODULE)
set_package_properties(Geant4
PROPERTIES
TYPE ${mcPackageRequirement} DESCRIPTION
"more recent and more complete MC transport engine")
find_package(Geant4VMC MODULE)
set_package_properties(Geant4VMC PROPERTIES TYPE ${mcPackageRequirement})
find_package(FlukaVMC MODULE)
set_package_properties(FlukaVMC PROPERTIES TYPE OPTIONAL)
find_package(VGM MODULE)
set_package_properties(VGM PROPERTIES TYPE ${mcPackageRequirement})
find_package(HepMC3 MODULE)
set_package_properties(HepMC3
PROPERTIES
TYPE OPTIONAL DESCRIPTION
"the HepMC3 event record package")
find_package(MCStepLogger MODULE)
set_package_properties(MCStepLogger PROPERTIES TYPE ${mcPackageRequirement})
set(doBuildSimulation OFF)
if(pythia_FOUND
AND Geant3_FOUND
AND Geant4_FOUND
AND Geant4VMC_FOUND
AND VGM_FOUND
AND HepMC3_FOUND)
set(doBuildSimulation ON)
endif()
if(DEFINED BUILD_SIMULATION AND BUILD_SIMULATION AND NOT doBuildSimulation)
return()
endif()
if(NOT DEFINED BUILD_SIMULATION)
if(NOT BUILD_SIMULATION_DEFAULT)
option(BUILD_SIMULATION "Build simulation related parts" FALSE)
else()
option(BUILD_SIMULATION "Build simulation related parts"
${doBuildSimulation})
endif()
endif()