opentelemetry-cpp icon indicating copy to clipboard operation
opentelemetry-cpp copied to clipboard

Resolve dependencies in opentelemetry-cpp-config.cmake

Open tobim opened this issue 1 year ago • 5 comments

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.

Fixes # (issue)

Changes

Please provide a brief description of the changes here.

For significant contributions please make sure you have completed the following items:

  • [ ] CHANGELOG.md updated for non-trivial changes
  • [ ] Unit tests have been added
  • [ ] Changes in public API reviewed

tobim avatar Oct 12 '24 12:10 tobim

CLA Signed

The committers listed above are authorized under a signed CLA.

  • :white_check_mark: login: tobim (6252f46cf88a4b5d1db1b311535b6f0137bc049c, b92f316d96d9e5e8355df4b93ef1fd8703df4319)
  • :white_check_mark: login: marcalff / name: Marc Alff (34de4847041f474a02669dc398732451aadeef98)
  • :white_check_mark: login: lalitb / name: Lalit Kumar Bhasin (7225046b914332845fe8028938db4a3ae68f2dbd)

Deploy Preview for opentelemetry-cpp-api-docs canceled.

Name Link
Latest commit 7225046b914332845fe8028938db4a3ae68f2dbd
Latest deploy log https://app.netlify.com/sites/opentelemetry-cpp-api-docs/deploys/67211cfe9f75e50009cc4ab5

netlify[bot] avatar Oct 12 '24 12:10 netlify[bot]

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 87.91%. Comparing base (497eaf4) to head (7225046). Report is 150 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3094      +/-   ##
==========================================
+ Coverage   87.12%   87.91%   +0.79%     
==========================================
  Files         200      195       -5     
  Lines        6109     6133      +24     
==========================================
+ Hits         5322     5391      +69     
+ Misses        787      742      -45     

see 98 files with indirect coverage changes

codecov[bot] avatar Oct 13 '24 15:10 codecov[bot]

find_package will produce warning when it's called recursively. Shoud we just add warnings to let users call find_package for dependencies before otel-cpp?

owent avatar Oct 14 '24 06:10 owent

find_package will produce warning when it's called recursively.

What warnings? Calling find_package or find_dependency in config files is standard practice.

tobim avatar Oct 14 '24 06:10 tobim

I now realize that my earlier response might has come across as rude, which I did not intend. Please take a look at the docs for find_dependency here. Quoting:

It is designed to be used in a Package Configuration File (<PackageName>Config.cmake).

May I humbly request that you take another look?

tobim avatar Oct 22 '24 07:10 tobim

find_package will produce warning when it's called recursively.

What warnings? Calling find_package or find_dependency in config files is standard practice.

Sorry, calling find_package recursively with FindXXX.cmake will produce warnings, but won't with CONFIG package. Could you please also add find_dependency for OpenTracing, prometheus-cpp, CURL and ZLIB ?

owent avatar Oct 24 '24 07:10 owent

Thanks for the heads-up! I added the rest. Afaics CURL and ZLIB are only necessary when opentelemetry_http_client_curl is built as a static library, so I guarded that with NOT BUILD_SHARED_LIBS.

tobim avatar Oct 26 '24 08:10 tobim