-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
130 lines (114 loc) · 2.92 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
cmake_minimum_required(VERSION 3.14)
# LCG sets CPATH, which gets treated like -I by the compiler. We want to ignore
# warnings from libraries, by unsetting it here, it gets processed by the usual
# target_include_directories call, resulting in the desired -isystem flag.
unset(ENV{CPATH})
project(TrackingPipeline LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 20)
# set the install directories
# to be placed in the build directory
set(CMAKE_INSTALL_BINDIR bin)
set(CMAKE_INSTALL_LIBDIR lib)
# place build products in `<build>/bin` and `<build>/lib` for simple use
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}")
# TBB, ROOT::Core are required for the
# algorithm execution
find_package(
TBB
COMPONENTS
tbb
REQUIRED)
find_package(
ROOT
COMPONENTS
Core
RIO
Tree
Hist
Gpad
Net
Physics
GeomPainter
REQUIRED)
# Dictionary for the sim data
add_library(SimEventDict SHARED)
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/include/TrackingPipeline/Io/detail
)
ROOT_GENERATE_DICTIONARY(
G__SimEventDict
./include/TrackingPipeline/Io/detail/ROOTDictDefs.h
MODULE
SimEventDict
LINKDEF
./include/TrackingPipeline/Io/detail/LinkDef.h)
target_link_libraries(
SimEventDict
PRIVATE
ROOT::RIO
ROOT::Physics
ROOT::GeomPainter)
# Geant4 is required for the geometry
find_package(Geant4 REQUIRED)
# Boost is required for the Acts
find_package(Boost REQUIRED)
# The core components and the Algo
# infrastructure are required
find_package(
Acts
COMPONENTS
Core
Fatras
PluginGeant4
PluginJson
PluginFpeMonitoring
REQUIRED)
# source files will be added later
add_library(
TrackingPipelineCore SHARED "")
target_link_libraries(
TrackingPipelineCore
PUBLIC
TBB::tbb
ROOT::Core
ROOT::RIO
ROOT::Tree
ROOT::Physics
ROOT::Hist
ROOT::Gpad
ROOT::Net
G__SimEventDict
ActsCore
ActsFatras
ActsPluginGeant4
ActsPluginJson
ActsPluginFpeMonitoring)
target_include_directories(
TrackingPipelineCore
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
)
# collect the library dependencies
add_subdirectory(src/Geometry)
add_subdirectory(src/Infrastructure)
add_subdirectory(src/Io)
add_subdirectory(src/MagneticField)
add_subdirectory(src/Material)
add_subdirectory(src/Simulation)
add_subdirectory(src/TrackFinding)
# macro to add a run executables
macro(add_run _name _source)
# automatically prefix the target name
set(_target "Run${_name}")
add_executable(${_target} ${_source})
# core link is public, so no need
# to add the includes
target_link_libraries(
${_target}
PRIVATE
TrackingPipelineCore)
endmacro()
# run has to be last, so that it can be
# linked against the library
add_subdirectory(Run)