-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
89 lines (73 loc) · 2.91 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
# The name of our project
project(smash-analysis NONE C)
# Fail if cmake is called in the source directory
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
message(FATAL_ERROR "You don't want to configure in the source directory!")
endif()
# Minimum cmake version this is tested on
cmake_minimum_required(VERSION 3.16.3)
## Tell cmake where to find our modules
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
include(FindPythonModules)
find_package(PythonInterp 3.8 REQUIRED)
find_package(PythonLibs 3.8)
find_package(Cython)
if (PYTHONLIBS_FOUND AND CYTHON_FOUND)
message(STATUS "Found PythonLibs and Cython, therefore can boost some code with cython.")
endif()
find_python_module(numpy VERSION 1.17.4 REQUIRED)
find_python_module(scipy VERSION 1.3.3 REQUIRED)
find_python_module(matplotlib VERSION 3.3.1 REQUIRED)
find_python_module(argparse VERSION 1.1 REQUIRED)
find_python_module(yaml VERSION 5.3.1 REQUIRED)
find_python_module(pandas VERSION 0.25.3 REQUIRED)
find_program(SMASH smash PATHS ${SMASH_PATH} NO_DEFAULT_PATH)
if(NOT SMASH)
message(FATAL_ERROR
"SMASH not found. Please specify a path to the SMASH build directory "
"by passing '-DSMASH_PATH=...' to cmake.")
else()
message(STATUS "Found SMASH: ${SMASH}")
# copy executable
file(COPY ${SMASH} DESTINATION ${CMAKE_BINARY_DIR})
endif()
# generate git statistics, requires gitstats in the path
find_program(GITSTATS gitstats)
if(GITSTATS)
message(STATUS "gitstats found at ${GITSTATS}")
add_custom_target(stats
COMMAND ${GITSTATS} ${PROJECT_SOURCE_DIR} ${PROJECT_BINARY_DIR}/gitstats
COMMENT "Generating git statistics")
endif()
# Decide whether to plot experimental data as well. Note that in this case,
# the path to the experimental_data directory needs to be passed
if(EXP_DATA)
option(WITH_EXP_DATA "Plot experimental data points as well." ON)
endif(EXP_DATA)
if(WITH_EXP_DATA)
if(EXP_DATA)
message(STATUS "Found experimental data: ${EXP_DATA}")
message(STATUS "Comparison to experimental measurements will be plotted.")
else()
message(WARNING "Experimental data not found and will not be plotted. Provide path to experimental_data directory via
cmake .. -DEXP_DATA=path/to/exp/data")
endif(EXP_DATA)
endif(WITH_EXP_DATA)
# 1) elementary tests
add_subdirectory(test/cross_sections)
add_subdirectory(test/angular_distributions)
# 2) box tests
add_subdirectory(test/detailed_balance)
add_subdirectory(test/elastic_box)
add_subdirectory(test/densities)
# 3) collider tests
add_subdirectory(test/FOPI_pions)
add_subdirectory(test/dileptons)
add_subdirectory(test/energy_scan)
if(SAMPLED_LISTS)
# 4) afterburner test
add_subdirectory(test/afterburner)
else()
message(STATUS "No path for download path for sampled particle lists was given, afterburner target not available. Specify via
cmake .. -DSAMPLED_LISTS=/link/to/lists")
endif(SAMPLED_LISTS)