Skip to content

Commit

Permalink
[BUILD] Fix if check on environment variable and add CMake variable (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomsonTan authored Jun 29, 2023
1 parent efde010 commit 313b04d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions cmake/opentelemetry-build-external-component.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@
# - OPENTELEMETRY_EXTERNAL_COMPONENT_URL Setting github-repo of external component
# as env variable


# Add custom vendor component from local path, or GitHub repo
if(DEFINED $ENV{OPENTELEMETRY_EXTERNAL_COMPONENT_PATH})
# Prefer CMake option, then env variable, then URL.
if(OPENTELEMETRY_EXTERNAL_COMPONENT_PATH)
# Add custom component path to build tree and consolidate binary artifacts in
# current project binary output directory.
add_subdirectory(${OPENTELEMETRY_EXTERNAL_COMPONENT_PATH}
${PROJECT_BINARY_DIR}/external)
elseif(DEFINED ENV{OPENTELEMETRY_EXTERNAL_COMPONENT_PATH})
# Add custom component path to build tree and consolidate binary artifacts in
# current project binary output directory.
add_subdirectory($ENV{OPENTELEMETRY_EXTERNAL_COMPONENT_PATH}
Expand Down

0 comments on commit 313b04d

Please sign in to comment.