forked from open-telemetry/opentelemetry-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
62 lines (49 loc) · 1.88 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
56
57
58
59
60
61
62
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
include_directories(include)
add_definitions(-DWITH_CURL)
add_library(
opentelemetry_exporter_zipkin_trace
src/zipkin_exporter.cc src/zipkin_exporter_factory.cc src/recordable.cc)
target_include_directories(
opentelemetry_exporter_zipkin_trace
PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>"
"$<INSTALL_INTERFACE:include>")
set_target_version(opentelemetry_exporter_zipkin_trace)
target_link_libraries(
opentelemetry_exporter_zipkin_trace
PUBLIC opentelemetry_trace opentelemetry_http_client_curl
nlohmann_json::nlohmann_json)
if(OPENTELEMETRY_INSTALL)
install(
TARGETS opentelemetry_exporter_zipkin_trace
EXPORT "${PROJECT_NAME}-target"
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(
DIRECTORY include/opentelemetry/exporters/zipkin
DESTINATION include/opentelemetry/exporters
FILES_MATCHING
PATTERN "*.h"
PATTERN "recordable.h" EXCLUDE)
endif()
if(BUILD_TESTING)
add_definitions(-DGTEST_LINKED_AS_SHARED_LIBRARY=1)
add_executable(zipkin_recordable_test test/zipkin_recordable_test.cc)
target_link_libraries(
zipkin_recordable_test ${GTEST_BOTH_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}
opentelemetry_exporter_zipkin_trace opentelemetry_resources)
gtest_add_tests(
TARGET zipkin_recordable_test
TEST_PREFIX exporter.
TEST_LIST zipkin_recordable_test)
add_executable(zipkin_exporter_test test/zipkin_exporter_test.cc)
target_link_libraries(
zipkin_exporter_test ${GTEST_BOTH_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}
${GMOCK_LIB} opentelemetry_exporter_zipkin_trace opentelemetry_resources)
gtest_add_tests(
TARGET zipkin_exporter_test
TEST_PREFIX exporter.
TEST_LIST zipkin_exporter_test)
endif() # BUILD_TESTING