forked from jupp0r/prometheus-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
70 lines (54 loc) · 1.52 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
68
69
70
cmake_minimum_required(VERSION 2.8.12.2 FATAL_ERROR)
project(prometheus-cpp)
enable_testing()
include(GNUInstallDirs)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_LIST_DIR}/cmake)
if(NOT DEFINED CMAKE_CXX_STANDARD AND UNIX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
endif()
find_package(GoogleBenchmark)
find_package(Protobuf REQUIRED)
find_package(ZLIB REQUIRED)
find_package(Telegraf)
# suppress warnings
if(APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations")
endif()
# civetweb
set(CIVETWEB_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/3rdparty/civetweb/include)
add_library(civetweb OBJECT
3rdparty/civetweb/include/CivetServer.h
3rdparty/civetweb/include/civetweb.h
3rdparty/civetweb/src/CivetServer.cpp
3rdparty/civetweb/src/civetweb.c
3rdparty/civetweb/src/handle_form.inl
3rdparty/civetweb/src/md5.inl
)
target_compile_definitions(civetweb PRIVATE
USE_IPV6
NDEBUG
NO_CGI
NO_CACHING
NO_SSL
NO_FILES
)
target_include_directories(civetweb PUBLIC
${CIVETWEB_INCLUDE_DIR}
)
# google mock
add_library(gmock_main STATIC EXCLUDE_FROM_ALL
3rdparty/googletest/googletest/src/gtest-all.cc
3rdparty/googletest/googlemock/src/gmock-all.cc
3rdparty/googletest/googlemock/src/gmock_main.cc
)
target_include_directories(gmock_main
PUBLIC
3rdparty/googletest/googletest/include
3rdparty/googletest/googlemock/include
PRIVATE
3rdparty/googletest/googletest
3rdparty/googletest/googlemock
)
# prometheus-cpp
add_subdirectory(lib)
add_subdirectory(tests)