forked from open-telemetry/opentelemetry-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
49 lines (40 loc) · 1.64 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
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
add_library(opentelemetry_exporter_elasticsearch_logs
src/es_log_record_exporter.cc src/es_log_recordable.cc)
set_target_properties(opentelemetry_exporter_elasticsearch_logs
PROPERTIES EXPORT_NAME elasticsearch_log_record_exporter)
set_target_version(opentelemetry_exporter_elasticsearch_logs)
target_include_directories(
opentelemetry_exporter_elasticsearch_logs
PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>"
"$<INSTALL_INTERFACE:include>")
target_link_libraries(
opentelemetry_exporter_elasticsearch_logs
PUBLIC opentelemetry_trace opentelemetry_logs opentelemetry_http_client_curl
nlohmann_json::nlohmann_json)
if(OPENTELEMETRY_INSTALL)
install(
TARGETS opentelemetry_exporter_elasticsearch_logs
EXPORT "${PROJECT_NAME}-target"
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(
DIRECTORY include/opentelemetry/exporters/elasticsearch
DESTINATION include/opentelemetry/exporters
FILES_MATCHING
PATTERN "*.h"
PATTERN "es_log_recordable.h" EXCLUDE)
endif()
if(BUILD_TESTING)
add_executable(es_log_record_exporter_test
test/es_log_record_exporter_test.cc)
target_link_libraries(
es_log_record_exporter_test ${GTEST_BOTH_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT} opentelemetry_exporter_elasticsearch_logs)
gtest_add_tests(
TARGET es_log_record_exporter_test
TEST_PREFIX exporter.
TEST_LIST es_log_record_exporter_test)
endif() # BUILD_TESTING