Skip to content

Commit

Permalink
Provide a CMake target for prometheus_exporter_utils
Browse files Browse the repository at this point in the history
  • Loading branch information
dufferzafar authored and Shadab Zafar committed Apr 23, 2024
1 parent 054b0dc commit 38a75d7
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions exporters/prometheus/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,25 @@ endif()
target_link_libraries(opentelemetry_exporter_prometheus
PUBLIC opentelemetry_metrics ${PROMETHEUS_CPP_TARGETS})

# We create a separate target for utils library
add_library(
opentelemetry_exporter_prometheus_utils
src/exporter_utils.cc)

set_target_properties(opentelemetry_exporter_prometheus_utils
PROPERTIES EXPORT_NAME prometheus_exporter_utils)
set_target_version(opentelemetry_exporter_prometheus_utils)

target_include_directories(
opentelemetry_exporter_prometheus_utils
PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>"
"$<INSTALL_INTERFACE:include>")

list(APPEND PROMETHEUS_EXPORTER_TARGETS opentelemetry_exporter_prometheus_utils)
target_link_libraries(
opentelemetry_exporter_prometheus_utils
PUBLIC opentelemetry_metrics prometheus-cpp::core)

if(OPENTELEMETRY_INSTALL)
install(
TARGETS ${PROMETHEUS_EXPORTER_TARGETS}
Expand Down

0 comments on commit 38a75d7

Please sign in to comment.