forked from celeritas-project/celeritas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
115 lines (100 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
109
110
111
112
113
114
115
#----------------------------------*-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)
#-----------------------------------------------------------------------------#
if(NOT CELERITAS_USE_Geant4)
set(_needs_geant4 DISABLE)
else()
celeritas_get_g4libs(_g4_geo_libs geometry)
celeritas_get_g4libs(_g4_global_libs global)
endif()
if(CELERITAS_UNITS STREQUAL "CGS")
set(_fixme_cgs)
else()
# Unit tests haven't yet been updated to include the correct units
set(_fixme_cgs DISABLE)
endif()
#-----------------------------------------------------------------------------#
# LIBRARY
#-----------------------------------------------------------------------------#
set(SOURCES
LazyGeoManager.cc
GenericGeoTestBase.cc
)
if(CELERITAS_USE_Geant4 AND CELERITAS_REAL_TYPE STREQUAL "double")
list(APPEND SOURCES
g4/GeantGeoTestBase.cc
)
endif()
if(CELERITAS_USE_VecGeom)
list(APPEND SOURCES
vg/VecgeomTestBase.cc
)
list(APPEND PRIVATE_DEPS VecGeom::vecgeom)
endif()
celeritas_add_library(testcel_geocel ${SOURCES})
celeritas_target_link_libraries(testcel_geocel
PUBLIC
Celeritas::testcel_harness Celeritas::geocel
PRIVATE
Celeritas::testcel_core ${_g4_geo_libs} ${VecGeom_LIBRARIES}
)
#-----------------------------------------------------------------------------#
# SETUP
#-----------------------------------------------------------------------------#
celeritas_setup_tests(SERIAL
PREFIX geocel
LINK_LIBRARIES Celeritas::testcel_geocel Celeritas::testcel_core
Celeritas::geocel
)
#-----------------------------------------------------------------------------#
# TESTS
#-----------------------------------------------------------------------------#
celeritas_add_test(BoundingBox.test.cc
LINK_LIBRARIES ${nlohmann_json_LIBRARIES}
)
#-----------------------------------------------------------------------------#
# VecGeom
if(CELERITAS_USE_VecGeom)
# Vecgeom uses global counters that interfere with copying data to GPU and
# change the internal numbering.
set(_vecgeom_tests)
if(VecGeom_GDML_FOUND)
list(APPEND _vecgeom_tests
"SimpleCmsTest.*"
)
if(NOT VecGeom_SURF_FOUND)
# TODO: vecgeom surface doesn't support some of these shapes
list(APPEND _vecgeom_tests
"FourLevelsTest.*"
"SolidsTest.*"
"CmseTest.*"
)
endif()
endif()
if(CELERITAS_USE_Geant4)
list(APPEND _vecgeom_tests
"FourLevelsGeantTest.*"
"SolidsGeantTest.*"
"ZnenvGeantTest.*"
)
endif()
if(NOT _vecgeom_tests)
# Bad: no way of setting up geometry!
set(_vecgeom_tests DISABLE)
endif()
celeritas_add_device_test(vg/Vecgeom
LINK_LIBRARIES VecGeom::vecgeom
FILTER ${_vecgeom_tests}
${_fixme_cgs}
)
endif()
if(CELERITAS_USE_Geant4)
celeritas_add_test(ScopedGeantLogger.test.cc LINK_LIBRARIES ${_g4_global_libs})
endif()
if(CELERITAS_USE_Geant4 AND CELERITAS_REAL_TYPE STREQUAL "double")
celeritas_add_test(g4/GeantGeo.test.cc LINK_LIBRARIES ${_g4_geo_libs})
celeritas_add_test(GeantGeoUtils.test.cc LINK_LIBRARIES ${_g4_geo_libs})
endif()
#-----------------------------------------------------------------------------#