Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[INSTALL] Resolve dependencies in opentelemetry-cpp-config.cmake #3094

Merged
merged 4 commits into from
Oct 30, 2024

Conversation

tobim
Copy link
Contributor

@tobim tobim commented Oct 12, 2024

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

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`.
@tobim tobim requested a review from a team as a code owner October 12, 2024 12:23
Copy link

linux-foundation-easycla bot commented Oct 12, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

Copy link

netlify bot commented Oct 12, 2024

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

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

Copy link

codecov bot commented Oct 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

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

@owent
Copy link
Member

owent commented Oct 14, 2024

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?

@tobim
Copy link
Contributor Author

tobim commented Oct 14, 2024

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
Copy link
Contributor Author

tobim commented Oct 22, 2024

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?

@owent
Copy link
Member

owent commented Oct 24, 2024

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 ?

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

If necessary, `CURL` and `ZLIB` are also resolved.
@tobim
Copy link
Contributor Author

tobim commented Oct 26, 2024

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.

Copy link
Member

@owent owent left a comment

Choose a reason for hiding this comment

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

LGTM, thanks

find_dependency(Threads)

if(@WITH_ABSEIL@)
find_dependency(absl)
Copy link
Member

Choose a reason for hiding this comment

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

I add absl in #3041 , which alos consider protobuf's version and gRpc

@marcalff marcalff added the ok-to-merge The PR is ok to merge (has two approves or raised by a maintainer/approver and has one approve) label Oct 30, 2024
@marcalff marcalff changed the title Resolve dependencies in opentelemetry-cpp-config.cmake [INSTALL] Resolve dependencies in opentelemetry-cpp-config.cmake Oct 30, 2024
@marcalff marcalff merged commit 6292a6a into open-telemetry:main Oct 30, 2024
55 of 56 checks passed
@tobim tobim deleted the cmake-config-find-dependencies branch October 30, 2024 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ok-to-merge The PR is ok to merge (has two approves or raised by a maintainer/approver and has one approve)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants