This repository has been archived by the owner on Nov 24, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
81 lines (66 loc) · 2.12 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
71
72
73
74
75
76
77
78
79
80
81
cmake_minimum_required(VERSION 3.16.3)
project(texugo)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
# Downloading CPM file
set(CPM_DOWNLOAD_VERSION 0.27.2)
set(CPM_DOWNLOAD_LOCATION "${CMAKE_BINARY_DIR}/cmake/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
if(NOT (EXISTS ${CPM_DOWNLOAD_LOCATION} AND CPM_VERSION STREQUAL CPM_DOWNLOAD_VERSION))
message(STATUS "Downloading CPM.cmake")
file(DOWNLOAD https://github.com/TheLartians/CPM.cmake/releases/download/v${CPM_DOWNLOAD_VERSION}/CPM.cmake ${CPM_DOWNLOAD_LOCATION})
endif()
include(${CPM_DOWNLOAD_LOCATION})
# Nlohmann Json
CPMAddPackage(
NAME nlohmann_json
GITHUB_REPOSITORY nlohmann/json
VERSION 3.9.1)
# spdlog
CPMAddPackage(
NAME spdlog
GITHUB_REPOSITORY gabime/spdlog
VERSION 1.7.0)
# Boost
CPMFindPackage(
NAME Boost
GITHUB_REPOSITORY Orphis/boost-cmake
VERSION 1.67.0
FIND_PACKAGE_ARGUMENTS "COMPONENTS system thread")
# Prometheus
CPMFindPackage(
NAME prometheus
GITHUB_REPOSITORY jupp0r/prometheus-cpp
GIT_TAG v0.10.0
VERSION 0.10.0)
add_compile_options(--coverage -O0)
enable_testing()
add_subdirectory(tests/unit)
add_library(texugo STATIC
src/com/ReceiverConnection.cpp
src/com/ConnectionManager.cpp
src/com/SenderConnection.cpp
src/config/Settings.cpp
src/log/Logger.cpp
src/message/ProcessMessage.cpp
src/message/MessageParser.cpp
src/metrics/MetricsExporter.cpp
src/metrics/MetricsMessage.cpp include/texugo/metrics/MetricsMessage.hpp)
target_include_directories(texugo
PUBLIC
$<INSTALL_INTERFACE:include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/src
${TEXUGO_GEN_BINARY_DIR}/src)
target_link_libraries(texugo
spdlog
nlohmann_json
prometheus-cpp::pull
Boost::system
Boost::thread)
add_executable(texugo_process
src/main/Texugo.cpp)
target_link_libraries(texugo --coverage)
target_link_libraries(texugo_process texugo)