This repository has been archived by the owner on May 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
105 lines (83 loc) · 3.22 KB
/
CMakeLists.txt
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
100
101
102
103
104
105
# Set the minimum version of CMake that's required
cmake_minimum_required(VERSION 3.12)
# Set the project name
project(
SimCore
VERSION 1.4.0
DESCRIPTION "Core classes needed to run the Simulator."
LANGUAGES CXX)
# Search and configure ROOT
find_package(ROOT CONFIG REQUIRED)
# Search for Boost
find_package(Boost REQUIRED
COMPONENTS log)
option(BUILD_EVENT_ONLY "Build the event library." ON)
if(BUILD_EVENT_ONLY)
register_event_object(module_path "SimCore/Event" namespace "ldmx"
class "SimCalorimeterHit" type "collection")
register_event_object(module_path "SimCore/Event" namespace "ldmx"
class "SimTrackerHit" type "collection")
register_event_object(module_path "SimCore/Event" namespace "ldmx"
class "SimParticle" type "map" key "int")
# Generate the files needed to build the event classes.
setup_library(module SimCore name Event
dependencies ROOT::Core
register_target)
return()
endif()
# Configure Geant4
setup_geant4_target()
# include dark brem simulation
add_subdirectory(G4DarkBreM)
setup_library(module SimCore
name PhotoNuclearModels
dependencies SimCore::SimCore)
# Set the LHE Reading Library
setup_library(module SimCore
name LHE
dependencies Framework::Exception
Geant4::Interface)
# Library of our interactions with G4
setup_library(module SimCore
name G4User
dependencies Framework::Framework
Geant4::Interface)
# Get a list of all of the source files.
file(GLOB SRC_FILES CONFIGURE_DEPDENDS ${PROJECT_SOURCE_DIR}/src/SimCore/Geo/[a-zA-Z]*.cxx
${PROJECT_SOURCE_DIR}/src/SimCore/[a-zA-Z]*.cxx)
# Setup the library
setup_library(module SimCore
dependencies Geant4::Interface
ROOT::Physics
Framework::Configure
Framework::Framework
SimCore::G4User
G4DarkBreM
DetDescr::DetDescr
Boost::log
"${registered_targets}"
sources ${SRC_FILES})
# Setup the biasing operators library
setup_library(module SimCore
name BiasOperators
dependencies SimCore::SimCore)
# Primary Generators library
setup_library(module SimCore
name Generators
dependencies SimCore::SimCore SimCore::LHE)
# Sensitive Detectors library
setup_library(module SimCore
name SDs
dependencies SimCore::SimCore)
# Set some target properties
set_target_properties(SimCore
PROPERTIES CXX_STANDARD 17
CXX_STANDARD_REQUIRED YES
CXX_EXTENSIONS NO)
setup_python(package_name ${PYTHON_PACKAGE_NAME}/SimCore)
# run all *.py files in test during testing
setup_test(config_dir test)
# add visualization executable
add_executable(g4-vis ${PROJECT_SOURCE_DIR}/src/SimCore/g4_vis.cxx)
target_link_libraries(g4-vis PRIVATE Geant4::Interface SimCore::SimCore)
install(TARGETS g4-vis DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)