-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
40 lines (29 loc) · 892 Bytes
/
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
cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
cmake_policy(VERSION 3.12...3.18)
project(g4run)
list(INSERT CMAKE_MODULE_PATH 0 ${PROJECT_SOURCE_DIR}/cmake)
find_package(Geant4 REQUIRED gdml)
find_package(Pythia)
add_executable(g4run
actions.cc
field.cc
geometry.cc
init.cc
main.cc
primary.cc
)
separate_arguments(Geant4_CXX_FLAGS)
target_compile_options(g4run PRIVATE ${Geant4_CXX_FLAGS})
target_compile_definitions(g4run PRIVATE ${Geant4_DEFINITIONS})
target_include_directories(g4run PRIVATE ${Geant4_INCLUDE_DIRS})
target_link_libraries(g4run PRIVATE ${Geant4_LIBRARIES})
if(Pythia_FOUND)
target_compile_definitions(g4run PRIVATE USE_PYTHIA)
target_link_libraries(g4run PRIVATE Pythia::Pythia)
endif()
include(GNUInstallDirs)
install(TARGETS g4run RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
include(CTest)
if(BUILD_TESTING)
add_subdirectory(perf)
endif()