-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
61 lines (49 loc) · 1.16 KB
/
CMakeLists.txt
File metadata and controls
61 lines (49 loc) · 1.16 KB
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
# --- cmake version ---
cmake_minimum_required(VERSION 3.21)
# --- project ---
project(ba7lya.pid LANGUAGES CXX)
# --- includes ---
include(CTest)
include(GoogleTest)
enable_testing()
# --- build options ---
option(${PROJECT_NAME}_BUILD_BENCHMARK "Build the benchmark" OFF)
option(${PROJECT_NAME}_BUILD_EXAMPLES "Build demo programs" ON)
option(${PROJECT_NAME}_BUILD_TEST "Build Test" OFF)
# --- dependencies ---
find_package(benchmark CONFIG REQUIRED)
find_package(GTest CONFIG REQUIRED)
find_package(ode CONFIG REQUIRED)
# --- target ---
add_library(${PROJECT_NAME} INTERFACE)
# --- include directories ---
target_include_directories(
${PROJECT_NAME}
INTERFACE
${PROJECT_SOURCE_DIR}/include/
)
# --- compile features ---
target_compile_features(
${PROJECT_NAME}
INTERFACE
cxx_std_23
)
# --- link libraries ---
target_link_libraries(
${PROJECT_NAME}
INTERFACE
ODE::ODE
)
# --- benchmarks ---
if(${PROJECT_NAME}_BUILD_BENCHMARK)
add_subdirectory(benchmark)
endif()
# --- demo ---
if(${PROJECT_NAME}_BUILD_EXAMPLES)
add_subdirectory(examples)
endif()
# --- unit tests ---
if(${PROJECT_NAME}_BUILD_TEST)
enable_testing()
add_subdirectory(test)
endif()