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

OpenTelemetry's cmake file claims to publish OPENTELEMETRY_CPP_FOUND/etc. but really publishes OPENTELEMETRY-CPP_FOUND - with a dash. #2212

Closed
niande-xbox opened this issue Jun 30, 2023 · 2 comments · Fixed by #2215
Labels
bug Something isn't working

Comments

@niande-xbox
Copy link

niande-xbox commented Jun 30, 2023

Describe your environment
Users of this library will look at the CMAKE file cmake/opentelemetry-cpp-config.cmake.in (as did opentelemetry-cpp-contrib and try to use that target, but if you print CMAKE variables, you'll see that the _FOUND variable actually has the dash, which makes sense if you look at the find_package_handle_standard_args call at the bottom of this file.

Steps to reproduce
Print the CMAKE variables after running find_package(opentelemetry-cpp CONFIG QUIET), and you'll see: -- opentelemetry-cpp_FOUND=1 not -- opentelemetry_cpp_FOUND=1.

What is the expected behavior?
The documented CMAKE variables (which have an underscore rather than a dash) should match the actual CMAKE variables (with are with dashes).

What is the actual behavior?
They do not match.

Additional context
This leads to other dependent repos failing to include opentelemetry-cpp correctly.

@niande-xbox niande-xbox added the bug Something isn't working label Jun 30, 2023
@lalitb
Copy link
Member

lalitb commented Jun 30, 2023

Thanks for reporting. We can probably document it here with a snippet - https://github.com/open-telemetry/opentelemetry-cpp/blob/main/INSTALL.md#incorporating-into-an-existing-cmake-project. And fix the naming here -

# OPENTELEMETRY_CPP_FOUND - True if opentelemetry-cpp found.

@owent
Copy link
Member

owent commented Jul 1, 2023

The <package name>_FOUND is generated by cmake automatically, it's not always OPENTELEMETRY-CPP_FOUND , but may be opentelemetry-cpp_FOUND when we use find_package(opentelemetry-cpp) . I think we can add a alias of <package name>_FOUND which named OPENTELEMETRY_CPP_FOUND .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants