Skip to content

Commit

Permalink
Resolve dependencies in opentelemetry-cpp-config.cmake
Browse files Browse the repository at this point in the history
Before this change, consumers of the exported CMake targets had to know
which dependencies are needed to get the transitive target dependencies
like `absl::*`, `gRPC::grpc++`, or `protobuf::libprotobuf`.
  • Loading branch information
tobim committed Oct 12, 2024
1 parent 6445819 commit 6252f46
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion cmake/opentelemetry-cpp-config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,21 @@ set(OPENTELEMETRY_VERSION

# ##############################################################################

find_package(Threads)
include(CMakeFindDependencyMacro)

find_dependency(Threads)

if(@WITH_ABSEIL@)
find_dependency(absl)
endif()

if(@WITH_OTLP_GRPC@)
find_dependency(gRPC)
endif()

if("@Protobuf_FOUND@" OR "@PROTOBUF_FOUND@")
find_dependency(Protobuf)
endif()

set_and_check(OPENTELEMETRY_CPP_INCLUDE_DIRS "@PACKAGE_INCLUDE_INSTALL_DIR@")
set_and_check(OPENTELEMETRY_CPP_LIBRARY_DIRS "@PACKAGE_CMAKE_INSTALL_LIBDIR@")
Expand Down

0 comments on commit 6252f46

Please sign in to comment.