Skip to content

Commit

Permalink
[INSTALL] Resolve dependencies in opentelemetry-cpp-config.cmake (#3094)
Browse files Browse the repository at this point in the history
* Resolve dependencies in opentelemetry-cpp-config.cmake

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`.

* Add find_dependency calls for remaining deps

Now we also resolve `OpenTracing`, and `prometheus-cpp`.

If necessary, `CURL` and `ZLIB` are also resolved.

---------

Co-authored-by: Marc Alff <marc.alff@oracle.com>
Co-authored-by: Lalit Kumar Bhasin <lalit_fin@yahoo.com>
  • Loading branch information
3 people authored Oct 30, 2024
1 parent 5e62859 commit 6292a6a
Showing 1 changed file with 33 additions and 1 deletion.
34 changes: 33 additions & 1 deletion cmake/opentelemetry-cpp-config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,39 @@ 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("@OpenTracing_FOUND@")
find_dependency(OpenTracing)
endif()

if("@prometheus-cpp_FOUND@")
find_dependency(prometheus-cpp)
endif()

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

if (@WITH_HTTP_CLIENT_CURL@ AND NOT @BUILD_SHARED_LIBS@)
if("@CURL_FOUND@")
find_dependency(CURL)
endif()

if("@ZLIB_FOUND@")
find_dependency(ZLIB)
endif()
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

1 comment on commit 6292a6a

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'OpenTelemetry-cpp api Benchmark'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: 6292a6a Previous: 5e62859 Ratio
BM_SpinLockThrashing/2/process_time/real_time 1.4676282137594694 ms/iter 0.29036086563274033 ms/iter 5.05
BM_NaiveSpinLockThrashing/2/process_time/real_time 0.3806063670985746 ms/iter 0.17553197718089675 ms/iter 2.17
BM_ThreadYieldSpinLockThrashing/1/process_time/real_time 16.471552848815918 ms/iter 7.37896718476948 ms/iter 2.23

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.