-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
48 lines (39 loc) · 1.47 KB
/
CMakeLists.txt
File metadata and controls
48 lines (39 loc) · 1.47 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
cmake_minimum_required(VERSION 3.10)
project(LivePlotter)
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_CXX_FLAGS "-Wall -Wextra")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -gdwarf-4 -fno-omit-frame-pointer -fno-inline")
include(FetchContent)
# ---- Fetch ReflectCPP ----
FetchContent_Declare(
reflectcpp
GIT_REPOSITORY https://github.com/getml/reflect-cpp.git
GIT_TAG ff9cc716a1a2ca1b8a3a42841c1a494e53609704
)
FetchContent_MakeAvailable(reflectcpp)
# --------------------------
add_library(scoped_timers src/timing/scoped_timers.cpp)
target_include_directories(scoped_timers PUBLIC include)
# Build library
add_library(plotter src/plotter/publisher.cpp)
target_include_directories(plotter PUBLIC include)
target_link_libraries(plotter reflectcpp)
# Add examples if BUILD_EXAMPLES is enabled
option(BUILD_EXAMPLES "Build example programs" ON)
if(BUILD_EXAMPLES)
add_executable(ExampleTarget examples/plotter.cpp)
target_link_libraries(ExampleTarget plotter)
add_executable(TimerExample examples/timer.cpp)
target_link_libraries(TimerExample scoped_timers)
endif()
# # Add tests if BUILD_TESTS is enabled
# option(BUILD_TESTS "Build unit tests" ON)
# if(BUILD_TESTS)
# enable_testing()
# add_executable(JsonizeTests tests/jsonize_tests.cpp)
# target_link_libraries(JsonizeTests PRIVATE plotter gtest gtest_main)
# add_test(NAME JsonizeTests COMMAND JsonizeTests)
# endif()