Skip to content

Commit

Permalink
fix default case to include all components in the package
Browse files Browse the repository at this point in the history
  • Loading branch information
dbarker committed Dec 23, 2024
1 parent bd6685d commit 4cef852
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion cmake/opentelemetry-cpp-config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,20 @@ set(_OPENTELEMETRY_CPP_TARGETS

set(_FIND_ALL_COMPONENTS TRUE)

set(_OPENTELEMETRY_CPP_REQUESTED_COMPONENTS)

if(NOT DEFINED opentelemetry-cpp_FIND_COMPONENTS OR opentelemetry-cpp_FIND_COMPONENTS STREQUAL "")
# if no components are requested then find all installed components
set(_OPENTELEMETRY_CPP_REQUESTED_COMPONENTS ${_OPENTELEMETRY_CPP_COMPONENTS})

set(_TARGET_FILES_DIR "${CMAKE_CURRENT_LIST_DIR}")

foreach(_COMPONENT IN LISTS _OPENTELEMETRY_CPP_COMPONENTS)
set(_COMPONENT_TARGET_FILE "${_TARGET_FILES_DIR}/opentelemetry-cpp-${_COMPONENT}-target.cmake")
if(EXISTS "${_COMPONENT_TARGET_FILE}")
list(APPEND _OPENTELEMETRY_CPP_REQUESTED_COMPONENTS ${_COMPONENT})
endif()
endforeach()

else()
set(_FIND_ALL_COMPONENTS FALSE)
# check that the requested components are valid and installed
Expand Down

0 comments on commit 4cef852

Please sign in to comment.