@@ -306,6 +306,42 @@ endif()
306306# GNUInstallDirs.
307307include (GNUInstallDirs)
308308
309+ #
310+ # Do we need HTTP CLIENT CURL ?
311+ #
312+
313+ if (WITH_OTLP_HTTP
314+ OR WITH_ELASTICSEARCH
315+ OR WITH_ZIPKIN
316+ OR BUILD_W3CTRACECONTEXT_TEST
317+ OR WITH_EXAMPLES_HTTP)
318+ set (WITH_HTTP_CLIENT_CURL ON )
319+ else ()
320+ set (WITH_HTTP_CLIENT_CURL OFF )
321+ endif ()
322+
323+ #
324+ # Do we need ZLIB ?
325+ #
326+
327+ if ((NOT WITH_API_ONLY)
328+ AND WITH_HTTP_CLIENT_CURL
329+ AND WITH_OTLP_HTTP_COMPRESSION)
330+ include ("${opentelemetry-cpp_SOURCE_DIR}/cmake/zlib.cmake" )
331+ endif ()
332+
333+ #
334+ # Do we need CURL ?
335+ #
336+
337+ if ((NOT WITH_API_ONLY) AND WITH_HTTP_CLIENT_CURL)
338+ include ("${opentelemetry-cpp_SOURCE_DIR}/cmake/curl.cmake" )
339+ endif ()
340+
341+ #
342+ # Do we need prometheus-cpp ?
343+ #
344+
309345if (WITH_PROMETHEUS)
310346 include ("${opentelemetry-cpp_SOURCE_DIR}/cmake/prometheus-cpp.cmake" )
311347endif ()
@@ -389,50 +425,6 @@ if(WITH_OTLP_GRPC
389425 set (CMAKE_CXX_CLANG_TIDY ${SAVED_CMAKE_CXX_CLANG_TIDY} )
390426endif ()
391427
392- #
393- # Do we need HTTP CLIENT CURL ?
394- #
395-
396- if (WITH_OTLP_HTTP
397- OR WITH_ELASTICSEARCH
398- OR WITH_ZIPKIN
399- OR BUILD_W3CTRACECONTEXT_TEST
400- OR WITH_EXAMPLES_HTTP)
401- set (WITH_HTTP_CLIENT_CURL ON )
402- else ()
403- set (WITH_HTTP_CLIENT_CURL OFF )
404- endif ()
405-
406- #
407- # Do we need CURL ?
408- #
409-
410- if ((NOT WITH_API_ONLY) AND WITH_HTTP_CLIENT_CURL)
411- # No specific version required.
412- find_package (CURL REQUIRED)
413- # Set the CURL_VERSION from the legacy CURL_VERSION_STRING Required for CMake
414- # versions below 4.0
415- if (NOT DEFINED CURL_VERSION AND DEFINED CURL_VERSION_STRING)
416- set (CURL_VERSION ${CURL_VERSION_STRING} )
417- endif ()
418- endif ()
419-
420- #
421- # Do we need ZLIB ?
422- #
423-
424- if ((NOT WITH_API_ONLY)
425- AND WITH_HTTP_CLIENT_CURL
426- AND WITH_OTLP_HTTP_COMPRESSION)
427- # No specific version required.
428- find_package (ZLIB REQUIRED)
429- # Set the ZLIB_VERSION from the legacy ZLIB_VERSION_STRING Required for CMake
430- # versions below 3.26
431- if (NOT DEFINED ZLIB_VERSION AND DEFINED ZLIB_VERSION_STRING)
432- set (ZLIB_VERSION ${ZLIB_VERSION_STRING} )
433- endif ()
434- endif ()
435-
436428#
437429# Do we need NLOHMANN_JSON ?
438430#
@@ -672,11 +664,11 @@ endif()
672664if (gRPC_FOUND)
673665 message (STATUS "gRPC: ${gRPC_VERSION} " )
674666endif ()
675- if (CURL_FOUND )
676- message (STATUS "CURL: ${CURL_VERSION} " )
667+ if (CURL_VERSION )
668+ message (STATUS "CURL: ${CURL_VERSION} ( ${CURL_PROVIDER} ) " )
677669endif ()
678- if (ZLIB_FOUND )
679- message (STATUS "ZLIB: ${ZLIB_VERSION} " )
670+ if (ZLIB_VERSION )
671+ message (STATUS "ZLIB: ${ZLIB_VERSION} ( ${ZLIB_PROVIDER} ) " )
680672endif ()
681673if (USE_NLOHMANN_JSON)
682674 message (
0 commit comments