-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
69 lines (45 loc) · 1.88 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
cmake_minimum_required(VERSION 3.20)
project(evdscpp LANGUAGES CXX)
# Top-level CMakeLists.txt
# Set output directories for executables and libraries
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
# Enable testing
enable_testing()
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
include_directories(include)
include_directories(extern/nlohmann) # External dependencies
include_directories(extern/dotenv) # External dependencies
find_package(CURL REQUIRED)
add_subdirectory(src)
add_subdirectory(tests)
# #=======================================================================================================================
# # Valgrind check target
# #=======================================================================================================================
# find_program(VALGRIND "valgrind")
# if (VALGRIND)
# add_custom_target(valgrind_check
# COMMAND ${VALGRIND} --leak-check=full --show-leak-kinds=all --track-origins=yes --verbose
# $<TARGET_FILE:evdscpp>
# COMMENT "Running Valgrind memory check on evdscpp"
# DEPENDS evdscpp
# )
# else()
# message(WARNING "Valgrind not found. 'valgrind_check' target will not be available.")
# endif()
# Enable AddressSanitizer for memory error detection
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer -g")
#=======================================================================================================================
# Build instructions
#=======================================================================================================================
# To build and run the project:
# mkdir build
# cd build
# cmake ..
# make
# ./evdscpp
#
# To run Valgrind check:
# make valgrind_check