-
Notifications
You must be signed in to change notification settings - Fork 449
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-cpp superbuild #1384
Comments
I think we can search CONFIG packages first by setting CMAKE_FIND_PACKAGE_PREFER_CONFIG to |
# For old cmake versions
foreach(NEW_VAR_NAME
Protobuf_INCLUDE_DIR
Protobuf_LIBRARY
Protobuf_PROTOC_LIBRARIES
Protobuf_LIBRARY_DEBUG
Protobuf_PROTOC_LIBRARY_DEBUG
)
string(TOUPPER OLD_VAR_NAME "${NEW_VAR_NAME}")
if (NOT ${NEW_VAR_NAME} AND ${OLD_VAR_NAME})
set(${NEW_VAR_NAME} "${${OLD_VAR_NAME}}")
endif()
endforeach()
if(NOT TARGET protobuf::libprotobuf)
add_library(protobuf::libprotobuf IMPORTED)
set_target_properties(protobuf::libprotobuf PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${Protobuf_INCLUDE_DIR}"
IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "CXX;RC"
IMPORTED_LOCATION "${Protobuf_LIBRARY$<<CONFIG:Debug>:_DEBUG}"
)
endif()
if(NOT TARGET protobuf::libprotoc)
add_library(protobuf::libprotoc IMPORTED)
set_target_properties(protobuf::libprotoc PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${Protobuf_INCLUDE_DIR}"
INTERFACE_LINK_LIBRARIES "protobuf::libprotobuf"
IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "CXX;RC"
IMPORTED_LOCATION "${Protobuf_PROTOC_LIBRARIES$<<CONFIG:Debug>:_DEBUG}}"
)
endif() |
Thanks @owent, I fixed this by using another superbuild for protobuf as a dependency. |
Following the recommendations at https://grpc.io/docs/languages/cpp/quickstart/
I have installed gRPC 1.50.0 to
This worked, but is there a better way? |
Before opening a feature request against this repo, consider whether the feature should/could be implemented in the other OpenTelemetry client libraries. If so, please open an issue on opentelemetry-specification first.
Is your feature request related to a problem?
If so, provide a concise description of the problem.
I have a piece of cmake that builds OpenTelemetry-cpp:
Where grpc is another external project (similar to #1382). The build fails using this cmake because we use find_package in module mode which doesn't find grpc/protobuf because of name mismatch. This can be solved if we use config search mode first.
failure:
Describe the solution you'd like
What do you want to happen instead? What is the expected behavior?
We can use this:
Describe alternatives you've considered
Which alternative solutions or features have you considered?
Additional context
Add any other context about the feature request here.
The text was updated successfully, but these errors were encountered: