thirdparty-dependency-config.cmake 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. # Copyright The OpenTelemetry Authors
  2. # SPDX-License-Identifier: Apache-2.0
  3. #-----------------------------------------------------------------------
  4. # Third party dependencies supported by opentelemetry-cpp
  5. # Dependencies that must be found with find_dependency() when a user calls find_package(opentelemetry-cpp ...)
  6. # should be included in this list.
  7. #-----------------------------------------------------------------------
  8. set(OTEL_THIRDPARTY_DEPENDENCIES_SUPPORTED
  9. Threads
  10. ZLIB
  11. CURL
  12. nlohmann_json
  13. Protobuf
  14. gRPC
  15. prometheus-cpp
  16. OpenTracing
  17. )
  18. #-----------------------------------------------------------------------
  19. # Third party dependency target namespaces. Defaults to the dependency's project name if not set.
  20. # Only set if the target namespace is different from the project name (these are case sensitive).
  21. # set(OTEL_<dependency>_TARGET_NAMESPACE "<namespace>")
  22. #-----------------------------------------------------------------------
  23. set(OTEL_Protobuf_TARGET_NAMESPACE "protobuf")
  24. #-----------------------------------------------------------------------
  25. # Set the find_dependecy search mode - empty is default. Options: cmake default (empty string ""), "MODULE", or "CONFIG"
  26. # # set(OTEL_<dependency>_SEARCH_MODE "<search mode>")
  27. #-----------------------------------------------------------------------
  28. set(OTEL_Threads_SEARCH_MODE "")
  29. set(OTEL_ZLIB_SEARCH_MODE "")
  30. set(OTEL_CURL_SEARCH_MODE "")
  31. set(OTEL_nlohmann_json_SEARCH_MODE "CONFIG")
  32. set(OTEL_gRPC_SEARCH_MODE "CONFIG")
  33. set(OTEL_prometheus-cpp_SEARCH_MODE "CONFIG")
  34. set(OTEL_OpenTracing_SEARCH_MODE "CONFIG")
  35. # The search mode is set to "CONFIG" for Protobuf versions >= 3.22.0
  36. # to find Protobuf's abseil dependency properly until the FindProtobuf module is updated support the upstream protobuf-config.cmake.
  37. # See https://gitlab.kitware.com/cmake/cmake/-/issues/24321
  38. if(DEFINED Protobuf_VERSION AND Protobuf_VERSION VERSION_GREATER_EQUAL 3.22.0)
  39. set(OTEL_Protobuf_SEARCH_MODE "CONFIG")
  40. else()
  41. set(OTEL_Protobuf_SEARCH_MODE "")
  42. endif()