-
Notifications
You must be signed in to change notification settings - Fork 476
CMake install for opentelemetry-cpp-contrib in-tree build was broken #3392
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
Comments
@ThomsonTan Thanks for logging this. Can you share more about the in-tree build approach? |
@dbarker the contrib repo exporters could be included via below cmake line when configured.
|
Thanks Tom. That helps. I'll look into Currently the common CMake approaches to integrating #3368 will make it easier to add components with an |
Looking at #1937 and the discussion on that PR, the intent with the
To preserve that component injection functionality, and once #3368 is merged, each contrib cmake project would need to add an set_target_properties(opentelemetry_exporter_geneva_metrics PROPERTIES EXPORT_NAME geneva_metrics_exporter)
...
if(NOT MAIN_PROJECT)
otel_add_component(
COMPONENT exporters_geneva_metrics
TARGETS opentelemetry_exporter_geneva_metrics
FILES_DIRECTORY include/opentelemetry/exporters/geneva
FILES_DESTINATION include/opentelemetry/exporters
FILES_MATCHING PATTERN "*.h")
elseif(OPENTELEMETRY_INSTALL)
...
It is not clear that injecting the contrib components into the An alternative to the component injection approach is to use cmake's FetchContent module to add the core # Fetch from an existing clone and build
include(FetchContent)
FetchContent_Declare(opentelemetry-cpp SOURCE_DIR "<path/to/opentelemetry-cpp>")
FetchContent_MakeAvailable(opentelemetry-cpp)
...
target_link_libraries(foo PRIVATE opentelemetry-cpp::api) # Clone and build opentelemetry-cpp from a git tag
include(FetchContent)
FetchContent_Declare(
opentelemetry-cpp
GIT_REPOSITORY https://github.com/open-telemetry/opentelemetry-cpp.git
GIT_TAG v1.20.0)
FetchContent_MakeAvailable(opentelemetry-cpp)
...
target_link_libraries(foo PRIVATE opentelemetry-cpp::api) We could also consider creating a single @ThomsonTan What do you think? |
CMake components were introduced in PR #3220, but since there is no CMake components added for the contrib projects, they cannot be built and installed in tree with opentelemetry-cpp.
The text was updated successfully, but these errors were encountered: