File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed
Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -628,6 +628,8 @@ if(NOT WITH_API_ONLY)
628628 endif ()
629629endif ()
630630
631+ include (cmake/opentelemetry-build -external-component .cmake)
632+
631633if (OPENTELEMETRY_INSTALL)
632634 # Export cmake config and support find_packages(opentelemetry-cpp CONFIG)
633635 # Write config file for find_packages(opentelemetry-cpp CONFIG)
Original file line number Diff line number Diff line change 1+ # Copyright The OpenTelemetry Authors
2+ # SPDX-License-Identifier: Apache-2.0
3+
4+ # Enable building external components through otel-cpp build
5+ # The config options are
6+ # - OPENTELEMETRY_EXTERNAL_COMPONENT_PATH - Setting local path of the external
7+ # component as env variable
8+ # - OPENTELEMETRY_EXTERNAL_COMPONENT_URL Setting github-repo of external component
9+ # as env variable
10+
11+
12+ # Add custom vendor component from local path, or GitHub repo
13+ if (DEFINED $ENV{OPENTELEMETRY_EXTERNAL_COMPONENT_PATH} )
14+ # Add custom component path to build tree and consolidate binary artifacts in
15+ # current project binary output directory.
16+ add_subdirectory ($ENV{OPENTELEMETRY_EXTERNAL_COMPONENT_PATH}
17+ ${PROJECT_BINARY_DIR} /external)
18+ elseif (DEFINED $ENV{OPENTELEMETRY_EXTERNAL_COMPONENT_URL} )
19+ # This option requires CMake 3.11+: add standard remote repo to build tree.
20+ include (FetchContent)
21+ FetchContent_Declare(
22+ external
23+ GIT_REPOSITORY $ENV{OPENTELEMETRY_EXTERNAL_COMPONENT_URL}
24+ GIT_TAG "main" )
25+ FetchContent_GetProperties(external)
26+ if (NOT external_POPULATED)
27+ FetchContent_Populate(external)
28+ add_subdirectory (${external_SOURCE_DIR} )
29+ endif ()
30+ endif ()
You can’t perform that action at this time.
0 commit comments