forked from celeritas-project/celeritas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
70 lines (62 loc) · 1.94 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
#----------------------------------*-CMake-*----------------------------------#
# Copyright 2023-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
demo-rasterizer.cc
RDemoRunner.cc
ImageIO.cc
ImageStore.cc
)
if(CELERITAS_USE_CUDA OR CELERITAS_USE_HIP)
list(APPEND SOURCES
RDemoKernel.cu
)
if(CELERITAS_USE_HIP)
set_source_files_properties(
RDemoKernel.cu
PROPERTIES LANGUAGE HIP
)
endif()
endif()
set(_rasterizer_libs
Celeritas::celeritas
nlohmann_json::nlohmann_json
)
if(CELERITAS_CORE_GEO STREQUAL "VecGeom")
list(APPEND _rasterizer_libs VecGeom::vecgeom)
endif()
add_executable(demo-rasterizer ${SOURCES})
celeritas_target_link_libraries(demo-rasterizer ${_rasterizer_libs})
#-----------------------------------------------------------------------------#
# TESTS
#-----------------------------------------------------------------------------#
if(NOT BUILD_TESTING)
return()
endif()
set(_driver "${CMAKE_CURRENT_SOURCE_DIR}/simple-driver.py")
set(_gdml_inp "${CELER_APP_DATA_DIR}/two-boxes.gdml")
add_test(NAME "app/demo-rasterizer"
COMMAND "$<TARGET_FILE:Python::Interpreter>" "${_driver}" "${_gdml_inp}"
)
if((CELERITAS_CORE_GEO STREQUAL "ORANGE" AND NOT CELERITAS_USE_Geant4)
OR CELER_DISABLE_DEVICE)
# two-boxes.org.json isn't set up in the test directory
# or device is unavailable
set(_maybe_disable DISABLED true)
else()
set(_maybe_disable)
endif()
set(_env
"CELERITAS_DEMO_EXE=$<TARGET_FILE:demo-rasterizer>"
"CELER_DISABLE_PARALLEL=1"
)
set_tests_properties("app/demo-rasterizer" PROPERTIES
ENVIRONMENT "${_env}"
RESOURCE_LOCK gpu
REQUIRED_FILES "${_driver};${_gdml_inp}"
LABELS "app;nomemcheck;gpu"
${_maybe_disable}
)
#-----------------------------------------------------------------------------#