Utilisation de prometheus-cpp-dev

This commit is contained in:
2025-12-03 23:20:46 +01:00
parent 3b9d229559
commit 8c23e6b8f9
6 changed files with 170 additions and 77 deletions

57
CMakeLists.txt Normal file
View File

@@ -0,0 +1,57 @@
cmake_minimum_required(VERSION 3.15)
project(geii_exporter LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
# Activer warnings utiles
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic")
# Executable principal
add_executable(geii_exporter
main.cpp
)
# -------------------------------
# Librairies systèmes
# -------------------------------
# CURL
find_package(CURL REQUIRED)
# Microhttpd
find_library(MICROHTTPD_LIB microhttpd REQUIRED)
# Threads et compression
find_package(Threads REQUIRED)
find_library(Z_LIB z REQUIRED)
# ncursesw
find_library(NCURSESW_LIB ncursesw REQUIRED)
# RabbitMQ C client
find_library(RABBITMQ_LIB rabbitmq REQUIRED)
# Paho MQTT C client
find_library(PAHO_MQTT3C_LIB paho-mqtt3c REQUIRED)
# -------------------------------
# Prometheus C++
# -------------------------------
find_package(prometheus-cpp REQUIRED)
# -------------------------------
# Lien des bibliothèques
# -------------------------------
target_link_libraries(geii_exporter
prometheus-cpp::core
prometheus-cpp::pull
${CURL_LIBRARIES}
${MICROHTTPD_LIB}
Threads::Threads
${Z_LIB}
${NCURSESW_LIB}
${RABBITMQ_LIB}
${PAHO_MQTT3C_LIB}
)