-
Notifications
You must be signed in to change notification settings - Fork 449
/
Copy pathCMakeLists.txt
55 lines (50 loc) · 1.74 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
add_library(
opentelemetry_http_client_curl http_client_factory_curl.cc
http_client_curl.cc http_operation_curl.cc)
set_target_properties(opentelemetry_http_client_curl
PROPERTIES EXPORT_NAME http_client_curl)
set_target_version(opentelemetry_http_client_curl)
target_link_libraries(opentelemetry_http_client_curl
PUBLIC opentelemetry_common)
if(TARGET CURL::libcurl)
target_link_libraries(
opentelemetry_http_client_curl
PUBLIC opentelemetry_ext
PRIVATE CURL::libcurl)
else()
target_include_directories(opentelemetry_http_client_curl
INTERFACE "${CURL_INCLUDE_DIRS}")
target_link_libraries(
opentelemetry_http_client_curl
PUBLIC opentelemetry_ext
PRIVATE ${CURL_LIBRARIES})
endif()
if(WITH_CURL_LOGGING)
target_compile_definitions(opentelemetry_http_client_curl
PRIVATE ENABLE_CURL_LOGGING)
endif()
if(WITH_OTLP_HTTP_COMPRESSION)
if(TARGET ZLIB::ZLIB)
target_link_libraries(
opentelemetry_http_client_curl
PUBLIC opentelemetry_ext
PRIVATE ZLIB::ZLIB)
else()
target_include_directories(opentelemetry_http_client_curl
INTERFACE "${ZLIB_INCLUDE_DIRS}")
target_link_libraries(
opentelemetry_http_client_curl
PUBLIC opentelemetry_ext
PRIVATE ${ZLIB_LIBRARIES})
endif()
endif()
if(OPENTELEMETRY_INSTALL)
install(
TARGETS opentelemetry_http_client_curl
EXPORT "${PROJECT_NAME}-target"
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()