Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 27 additions & 9 deletions cmake/opentelemetry-proto.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -395,15 +395,6 @@ endif()
set_target_properties(opentelemetry_proto PROPERTIES EXPORT_NAME proto)
patch_protobuf_targets(opentelemetry_proto)

if(OPENTELEMETRY_INSTALL)
install(
DIRECTORY ${GENERATED_PROTOBUF_PATH}/opentelemetry
DESTINATION include
COMPONENT exporters_otlp_common
FILES_MATCHING
PATTERN "*.h")
endif()

if(TARGET protobuf::libprotobuf)
target_link_libraries(opentelemetry_proto PUBLIC protobuf::libprotobuf)
else() # cmake 3.8 or lower
Expand All @@ -424,3 +415,30 @@ if(BUILD_SHARED_LIBS)
set_property(TARGET ${proto_target} PROPERTY POSITION_INDEPENDENT_CODE ON)
endforeach()
endif()

if(OPENTELEMETRY_INSTALL)
install(
DIRECTORY ${GENERATED_PROTOBUF_PATH}/opentelemetry
DESTINATION include
COMPONENT exporters_otlp_common
FILES_MATCHING
PATTERN "*.h")

include(${PROJECT_SOURCE_DIR}/cmake/pkgconfig.cmake)

opentelemetry_add_pkgconfig(
proto
"OpenTelemetry - Protocol"
"Protocols for spans, metrics, and logs."
"protobuf"
)

if(WITH_OTLP_GRPC)
opentelemetry_add_pkgconfig(
proto_grpc
"OpenTelemetry - Protocol (gRPC)"
"Protocols for spans, metrics, and logs over gRPC."
"opentelemetry_proto grpc++ protobuf"
)
endif()
endif()
2 changes: 2 additions & 0 deletions cmake/pkgconfig.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0

include_guard(GLOBAL)

# Unlike functions, macros do not introduce a scope. This is an advantage when
# trying to set global variables, as we do here.
macro (opentelemetry_set_pkgconfig_paths)
Expand Down
Loading