-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
46 lines (35 loc) · 1.17 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
cmake_minimum_required(VERSION 3.19)
project(metrics-cpp VERSION 1.0)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)
option(METRICS_BUILD_SANITIZER "Enable selected sanitizer in build (address/thread/leak/undefined)" OFF)
option(METRICS_BUILD_TESTS "Build tests for this library" OFF)
include(sanitizer.cmake)
if(METRICS_BUILD_SANITIZER)
enable_sanitizer(${METRICS_BUILD_SANITIZER})
endif()
# Boost
set(BOOST_USE_STATIC_LIBS ON)
set(BOOST_ENABLE_CMAKE ON)
if (METRICS_BUILD_SANITIZER)
set(BOOST_USE_ASAN ON)
endif()
find_package(Boost COMPONENTS asio accumulators beast json url REQUIRED)
find_package(OpenSSL CONFIG REQUIRED)
find_package(CURL CONFIG REQUIRED)
message(STATUS "Boost_INCLUDE_DIRS: [${Boost_INCLUDE_DIRS}]")
message(STATUS "Boost_LIBRARIES: [${Boost_LIBRARIES}]")
set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR})
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR})
add_subdirectory(src)
if (METRICS_BUILD_TESTS OR METRICS_BUILD_BENCHMARKS)
include(CTest)
enable_testing()
endif()
if (METRICS_BUILD_TESTS)
add_subdirectory(integration)
add_subdirectory(test)
endif()
if (METRICS_BUILD_BENCHMARKS)
add_subdirectory(benchmarks)
endif()