forked from celeritas-project/celeritas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
110 lines (92 loc) · 3.25 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
#----------------------------------*-CMake-*----------------------------------#
# Copyright 2024 UT-Battelle, LLC, and other Celeritas developers.
# See the top-level COPYRIGHT file for details.
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
#-----------------------------------------------------------------------------#
set(SOURCES)
set(PUBLIC_DEPS Celeritas::corecel)
#-----------------------------------------------------------------------------#
# Main code
#-----------------------------------------------------------------------------#
list(APPEND SOURCES
GeoParamsOutput.cc
rasterize/Image.cc
)
#-----------------------------------------------------------------------------#
# Configuration-dependent code
#-----------------------------------------------------------------------------#
if(CELERITAS_USE_JSON)
list(APPEND SOURCES
BoundingBoxIO.json.cc
rasterize/ImageIO.json.cc
)
list(APPEND PRIVATE_DEPS nlohmann_json::nlohmann_json)
endif()
if(CELERITAS_USE_VecGeom AND CELERITAS_USE_Geant4)
set( _cg4vg_sources
g4vg/Converter.cc
g4vg/LogicalVolumeConverter.cc
g4vg/SolidConverter.cc
)
celeritas_get_g4libs(_cg4vg_libs geometry)
list(APPEND _cg4vg_libs Celeritas::corecel VecGeom::vecgeom)
celeritas_add_object_library(geocel_g4vg ${_cg4vg_sources})
celeritas_target_link_libraries(geocel_g4vg PRIVATE ${_cg4vg_libs})
list(APPEND SOURCES $<TARGET_OBJECTS:geocel_g4vg>)
list(APPEND PRIVATE_DEPS geocel_g4vg)
endif()
if(CELERITAS_USE_Geant4)
set(_cg4_sources
GeantUtils.cc
GeantGeoUtils.cc
ScopedGeantExceptionHandler.cc
ScopedGeantLogger.cc
g4/GeantGeoParams.cc
g4/RaytraceImager.cc
g4/detail/GeantGeoNavCollection.cc
)
celeritas_get_g4libs(_cg4_libs global geometry persistency intercoms)
list(APPEND _cg4_libs Celeritas::corecel XercesC::XercesC)
celeritas_add_object_library(geocel_geant4 ${_cg4_sources})
celeritas_target_link_libraries(geocel_geant4 PRIVATE ${_cg4_libs})
list(APPEND SOURCES $<TARGET_OBJECTS:geocel_geant4>)
list(APPEND PRIVATE_DEPS geocel_geant4)
endif()
if(CELERITAS_USE_VecGeom)
list(APPEND SOURCES
vg/VecgeomParams.cc
vg/VecgeomParamsOutput.cc
vg/detail/VecgeomNavCollection.cc
vg/RaytraceImager.cc
)
if(VecGeom_GDML_FOUND)
list(APPEND PRIVATE_DEPS VecGeom::vgdml)
endif()
if(VecGeom_CUDA_FOUND AND VecGeom_SURF_FOUND)
# Special routines needed for surface
list(APPEND SOURCES
vg/VecgeomParams.surface.cu
)
endif()
if(CELERITAS_USE_CUDA)
# This needs to be public because its might be needed
# to resolve the symbols generate by the `nvcc -dlink` of
# one of the executable.
list(APPEND PUBLIC_DEPS VecGeom::vecgeom)
list(APPEND SOURCES
vg/RaytraceImager.cu
)
elseif(VecGeom_CUDA_FOUND)
# VecGeom is built with CUDA but Celeritas is not
list(APPEND PRIVATE_DEPS VecGeom::vecgeomcuda)
endif()
endif()
#-----------------------------------------------------------------------------#
# Create library
#-----------------------------------------------------------------------------#
celeritas_add_library(geocel ${SOURCES})
celeritas_target_link_libraries(geocel
PRIVATE ${PRIVATE_DEPS}
PUBLIC ${PUBLIC_DEPS}
)
#-----------------------------------------------------------------------------#