forked from open-telemetry/opentelemetry-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
93 lines (78 loc) · 3.39 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
add_library(opentelemetry_exporter_etw INTERFACE)
target_include_directories(
opentelemetry_exporter_etw
INTERFACE "$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>"
"$<INSTALL_INTERFACE:include>")
set_target_properties(opentelemetry_exporter_etw PROPERTIES EXPORT_NAME
etw_exporter)
target_link_libraries(
opentelemetry_exporter_etw INTERFACE opentelemetry_api opentelemetry_trace
nlohmann_json::nlohmann_json)
target_link_libraries(opentelemetry_exporter_etw INTERFACE opentelemetry_logs)
if(nlohmann_json_clone)
add_dependencies(opentelemetry_exporter_etw nlohmann_json::nlohmann_json)
endif()
if(OPENTELEMETRY_INSTALL)
install(
TARGETS opentelemetry_exporter_etw
EXPORT "${PROJECT_NAME}-target"
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(
DIRECTORY include/opentelemetry/exporters/etw
DESTINATION include/opentelemetry/exporters
FILES_MATCHING
PATTERN "*.h")
endif()
if(BUILD_TESTING)
add_executable(etw_provider_test test/etw_provider_test.cc)
add_executable(etw_tracer_test test/etw_tracer_test.cc)
add_executable(etw_logger_test test/etw_logger_test.cc)
add_executable(etw_tracer_test_enable_env_properties test/etw_tracer_test.cc)
add_executable(etw_logger_test_enable_env_properties test/etw_logger_test.cc)
target_link_libraries(etw_provider_test ${GTEST_BOTH_LIBRARIES}
opentelemetry_exporter_etw ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries(etw_tracer_test ${GTEST_BOTH_LIBRARIES}
opentelemetry_exporter_etw ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries(etw_logger_test ${GTEST_BOTH_LIBRARIES}
opentelemetry_exporter_etw ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries(
etw_tracer_test_enable_env_properties ${GTEST_BOTH_LIBRARIES}
opentelemetry_exporter_etw ${CMAKE_THREAD_LIBS_INIT})
target_compile_definitions(etw_tracer_test_enable_env_properties
PRIVATE ENABLE_ENV_PROPERTIES)
target_link_libraries(
etw_logger_test_enable_env_properties ${GTEST_BOTH_LIBRARIES}
opentelemetry_exporter_etw ${CMAKE_THREAD_LIBS_INIT})
target_compile_definitions(etw_logger_test_enable_env_properties
PRIVATE ENABLE_ENV_PROPERTIES)
if(WITH_BENCHMARK)
add_executable(etw_perf_test test/etw_perf_test.cc)
target_link_libraries(
etw_perf_test benchmark::benchmark ${GTEST_BOTH_LIBRARIES}
opentelemetry_exporter_etw ${CMAKE_THREAD_LIBS_INIT})
endif()
gtest_add_tests(
TARGET etw_provider_test
TEST_PREFIX exporter.
TEST_LIST etw_provider_test)
gtest_add_tests(
TARGET etw_tracer_test
TEST_PREFIX exporter.
TEST_LIST etw_tracer_test)
gtest_add_tests(
TARGET etw_logger_test
TEST_PREFIX exporter.
TEST_LIST etw_logger_test)
gtest_add_tests(
TARGET etw_tracer_test_enable_env_properties
TEST_PREFIX exporter.with_env_properties.
TEST_LIST etw_tracer_test_enable_env_properties)
gtest_add_tests(
TARGET etw_logger_test_enable_env_properties
TEST_PREFIX exporter.with_env_properties.
TEST_LIST etw_logger_test_enable_env_properties)
endif() # BUILD_TESTING