summaryrefslogtreecommitdiff
path: root/src/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r--src/CMakeLists.txt26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index b416faaf3..710d9e13e 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -217,6 +217,26 @@ endif(ENABLE_REDIS)
find_package(SQLite3 REQUIRED)
+OPTION(ENABLE_PROMETHEUS "Enable prometheus client support" FALSE)
+set(USE_PROMETHEUS FALSE)
+
+if(ENABLE_PROMETHEUS)
+ find_path(PROMETHEUS_CPP_INCLUDE_DIR NAMES prometheus/counter.h)
+ find_library(PROMETHEUS_PULL_LIBRARY NAMES prometheus-cpp-pull)
+ find_library(PROMETHEUS_CORE_LIBRARY NAMES prometheus-cpp-core)
+ if(PROMETHEUS_CPP_INCLUDE_DIR AND PROMETHEUS_PULL_LIBRARY AND PROMETHEUS_CORE_LIBRARY)
+ set(PROMETHEUS_LIBRARIES ${PROMETHEUS_PULL_LIBRARY} ${PROMETHEUS_CORE_LIBRARY})
+ set(USE_PROMETHEUS TRUE)
+ include_directories(${PROMETHEUS_CPP_INCLUDE_DIR})
+ endif(PROMETHEUS_CPP_INCLUDE_DIR AND PROMETHEUS_PULL_LIBRARY AND PROMETHEUS_CORE_LIBRARY)
+endif(ENABLE_PROMETHEUS)
+
+if(USE_PROMETHEUS)
+ message(STATUS "Prometheus client enabled.")
+else(USE_PROMETHEUS)
+ message(STATUS "Prometheus client disabled.")
+endif(USE_PROMETHEUS)
+
OPTION(ENABLE_SPATIAL "Enable SpatialIndex AreaStore backend" TRUE)
set(USE_SPATIAL FALSE)
@@ -597,6 +617,9 @@ if(BUILD_CLIENT)
if (USE_REDIS)
target_link_libraries(${PROJECT_NAME} ${REDIS_LIBRARY})
endif()
+ if (USE_PROMETHEUS)
+ target_link_libraries(${PROJECT_NAME} ${PROMETHEUS_LIBRARIES})
+ endif()
if (USE_SPATIAL)
target_link_libraries(${PROJECT_NAME} ${SPATIAL_LIBRARY})
endif()
@@ -632,6 +655,9 @@ if(BUILD_SERVER)
if (USE_REDIS)
target_link_libraries(${PROJECT_NAME}server ${REDIS_LIBRARY})
endif()
+ if (USE_PROMETHEUS)
+ target_link_libraries(${PROJECT_NAME}server ${PROMETHEUS_LIBRARIES})
+ endif()
if (USE_SPATIAL)
target_link_libraries(${PROJECT_NAME}server ${SPATIAL_LIBRARY})
endif()