-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
44 lines (34 loc) · 1.57 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
cmake_minimum_required (VERSION 3.12)
project(covid19_simulation)
set(CMAKE_EXPORT_COMPILE_COMMANDS On)
if(EXISTS ${CMAKE_BINARY_DIR}/conan_paths.cmake)
include(${CMAKE_BINARY_DIR}/conan_paths.cmake)
endif()
find_package(OpenMP)
find_package(Protobuf REQUIRED)
protobuf_generate_cpp(SRCS_SIMULATION HDRS_SIMULATION src/simulation_results.proto)
protobuf_generate_cpp(SRCS_COUNTRY HDRS_COUNTRY src/country_data.proto)
option(C19_EXPONENTIAL_GROWTH "Run with exponential growth" OFF)
add_executable(simulation src/simulation.cpp ${SRCS_SIMULATION} ${SRCS_COUNTRY} ${HDRS_SIMULATION}
${HDRS_COUNTRY})
target_compile_features(simulation PRIVATE cxx_std_17)
target_link_libraries(simulation PRIVATE $<$<BOOL:${OpenMP_FOUND}>:OpenMP::OpenMP_CXX>
protobuf::libprotobuf)
target_include_directories(simulation PRIVATE src/ ${CMAKE_CURRENT_BINARY_DIR}/)
target_compile_definitions(simulation PUBLIC $<$<BOOL:${C19_EXPONENTIAL_GROWTH}>:EXPONENTIAL_GROWTH>)
install(TARGETS simulation
RUNTIME DESTINATION bin
)
enable_testing()
find_package(GTest REQUIRED)
include(GoogleTest)
add_executable(test_stats tests/test_stats.cpp)
target_compile_features(test_stats PRIVATE cxx_std_17)
target_link_libraries(test_stats GTest::GTest GTest::Main)
target_include_directories(test_stats PRIVATE src/)
gtest_add_tests(TARGET test_stats)
add_executable(test_generators tests/test_generators.cpp)
target_compile_features(test_generators PRIVATE cxx_std_17)
target_link_libraries(test_generators GTest::GTest GTest::Main)
target_include_directories(test_generators PRIVATE src/)
gtest_add_tests(TARGET test_generators)