From 26e5ed48d81bb03fde52848ab394605dde0fb1a8 Mon Sep 17 00:00:00 2001 From: Tom Tan Date: Tue, 30 Jan 2024 14:22:56 -0800 Subject: [PATCH] [Geneva] add interface target for geneva-trace (#373) --- exporters/geneva-trace/CMakeLists.txt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/exporters/geneva-trace/CMakeLists.txt b/exporters/geneva-trace/CMakeLists.txt index bc095f4e1..3baec459e 100644 --- a/exporters/geneva-trace/CMakeLists.txt +++ b/exporters/geneva-trace/CMakeLists.txt @@ -12,6 +12,12 @@ if(MAIN_PROJECT) option(WITH_EXAMPLES "Build examples" ON) endif() +add_library(opentelemetry-cpp-geneva-trace-log-exporter INTERFACE) +target_include_directories( + opentelemetry-cpp-geneva-trace-log-exporter INTERFACE + $ + $) + if(WITH_EXAMPLES) include_directories(include) add_subdirectory(example) @@ -19,4 +25,15 @@ endif() if(OPENTELEMETRY_INSTALL) install(DIRECTORY include/ DESTINATION include) + + install( + TARGETS opentelemetry-cpp-geneva-trace-log-exporter + EXPORT "${PROJECT_NAME}-target") + + if(NOT MAIN_PROJECT) + install( + EXPORT "${PROJECT_NAME}-target" + NAMESPACE "${PROJECT_NAME}::" + DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}") + endif() endif() \ No newline at end of file