File tree Expand file tree Collapse file tree 21 files changed +233
-168
lines changed
install/test/cmake/component_tests/ext_dll Expand file tree Collapse file tree 21 files changed +233
-168
lines changed Original file line number Diff line number Diff line change 2
2
# SPDX-License-Identifier: Apache-2.0
3
3
4
4
add_subdirectory (common )
5
- include_directories ( common )
5
+
6
6
if (WITH_OTLP_GRPC
7
7
OR WITH_OTLP_HTTP
8
8
OR WITH_OTLP_FILE )
Original file line number Diff line number Diff line change 1
1
# Copyright The OpenTelemetry Authors
2
2
# SPDX-License-Identifier: Apache-2.0
3
-
4
- include_directories (${CMAKE_SOURCE_DIR} /exporters/ostream/include )
5
-
6
3
add_executable (batch_span_processor_example main.cc )
7
4
8
- target_link_libraries (batch_span_processor_example ${CMAKE_THREAD_LIBS_INIT}
9
- opentelemetry_exporter_ostream_span opentelemetry_trace )
5
+ target_link_libraries (
6
+ batch_span_processor_example PRIVATE opentelemetry-cpp::ostream_span_exporter
7
+ opentelemetry-cpp::trace )
Original file line number Diff line number Diff line change 1
1
# Copyright The OpenTelemetry Authors
2
2
# SPDX-License-Identifier: Apache-2.0
3
3
4
+ set (EXAMPLES_COMMON_DIR ${CMAKE_CURRENT_SOURCE_DIR} )
4
5
add_subdirectory (foo_library )
5
6
add_subdirectory (logs_foo_library )
6
7
add_subdirectory (metrics_foo_library )
Original file line number Diff line number Diff line change 1
1
# Copyright The OpenTelemetry Authors
2
2
# SPDX-License-Identifier: Apache-2.0
3
3
4
- if (DEFINED OPENTELEMETRY_BUILD_DLL )
5
- add_definitions (-DOPENTELEMETRY_BUILD_IMPORT_DLL )
6
- endif ()
7
-
8
4
add_library (common_foo_library foo_library.h foo_library.cc )
5
+
9
6
set_target_version (common_foo_library )
10
7
11
- target_link_libraries (common_foo_library PUBLIC ${CMAKE_THREAD_LIBS_INIT}
12
- opentelemetry_api )
8
+ if (DEFINED OPENTELEMETRY_BUILD_DLL )
9
+ target_compile_definitions (common_foo_library
10
+ PRIVATE OPENTELEMETRY_BUILD_IMPORT_DLL )
11
+ endif ()
12
+
13
+ target_include_directories (common_foo_library
14
+ PUBLIC "$<BUILD_INTERFACE:${EXAMPLES_COMMON_DIR} >" )
15
+ target_link_libraries (common_foo_library PRIVATE opentelemetry-cpp::api )
Original file line number Diff line number Diff line change 1
1
# Copyright The OpenTelemetry Authors
2
2
# SPDX-License-Identifier: Apache-2.0
3
3
4
+ add_library (common_logs_foo_library foo_library.h foo_library.cc )
5
+
6
+ set_target_version (common_logs_foo_library )
7
+
4
8
if (DEFINED OPENTELEMETRY_BUILD_DLL )
5
- add_definitions (-DOPENTELEMETRY_BUILD_IMPORT_DLL )
9
+ target_compile_definitions (common_logs_foo_library
10
+ PRIVATE OPENTELEMETRY_BUILD_IMPORT_DLL )
6
11
endif ()
7
12
8
- add_library (common_logs_foo_library foo_library.h foo_library.cc )
9
- set_target_version ( common_logs_foo_library )
13
+ target_include_directories (common_logs_foo_library
14
+ PUBLIC $< BUILD_INTERFACE: ${EXAMPLES_COMMON_DIR} > )
10
15
11
- target_link_libraries (common_logs_foo_library PUBLIC ${CMAKE_THREAD_LIBS_INIT}
12
- opentelemetry_api )
16
+ target_link_libraries (common_logs_foo_library PRIVATE opentelemetry-cpp::api )
Original file line number Diff line number Diff line change 1
1
# Copyright The OpenTelemetry Authors
2
2
# SPDX-License-Identifier: Apache-2.0
3
3
4
+ add_library (common_metrics_foo_library foo_library.h foo_library.cc )
5
+
6
+ set_target_version (common_metrics_foo_library )
7
+
4
8
if (DEFINED OPENTELEMETRY_BUILD_DLL )
5
- add_definitions (-DOPENTELEMETRY_BUILD_IMPORT_DLL )
9
+ target_compile_definitions (common_metrics_foo_library
10
+ PRIVATE OPENTELEMETRY_BUILD_IMPORT_DLL )
6
11
endif ()
7
12
8
- add_library (common_metrics_foo_library foo_library.h foo_library.cc )
9
- set_target_version ( common_metrics_foo_library )
13
+ target_include_directories (common_metrics_foo_library
14
+ PUBLIC $< BUILD_INTERFACE: ${EXAMPLES_COMMON_DIR} > )
10
15
11
- target_link_libraries (common_metrics_foo_library
12
- PUBLIC ${CMAKE_THREAD_LIBS_INIT} opentelemetry_api )
16
+ target_link_libraries (common_metrics_foo_library PRIVATE opentelemetry-cpp::api )
Original file line number Diff line number Diff line change @@ -5,5 +5,6 @@ project(etw_threadpool)
5
5
6
6
add_executable (etw_threadpool main.cc )
7
7
8
- target_link_libraries (etw_threadpool ${CMAKE_THREAD_LIBS_INIT}
9
- opentelemetry_api opentelemetry_exporter_etw )
8
+ target_link_libraries (
9
+ etw_threadpool PRIVATE Threads::Threads opentelemetry-cpp::api
10
+ opentelemetry-cpp::etw_exporter )
Original file line number Diff line number Diff line change @@ -28,11 +28,8 @@ patch_protobuf_targets(example_grpc_proto)
28
28
# Disable include-what-you-use on generated code.
29
29
set_target_properties (example_grpc_proto PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "" )
30
30
31
- include_directories (
32
- ${CMAKE_SOURCE_DIR} /exporters/ostream/include ${CMAKE_SOURCE_DIR} /ext/include
33
- ${CMAKE_SOURCE_DIR} /api/include/ ${CMAKE_SOURCE_DIR/} )
34
-
35
- include_directories (${CMAKE_CURRENT_BINARY_DIR} )
31
+ target_include_directories (
32
+ example_grpc_proto PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR} >" )
36
33
37
34
if (TARGET protobuf::libprotobuf )
38
35
target_link_libraries (example_grpc_proto PUBLIC gRPC::grpc++
@@ -45,7 +42,8 @@ endif()
45
42
46
43
foreach (_target client server )
47
44
add_executable (${_target} "${_target} .cc" )
48
- target_link_libraries (${_target} example_grpc_proto opentelemetry_trace
49
- opentelemetry_exporter_ostream_span )
45
+ target_link_libraries (
46
+ ${_target} PRIVATE example_grpc_proto
47
+ opentelemetry-cpp::ostream_span_exporter )
50
48
patch_protobuf_targets (${_target} )
51
49
endforeach ()
Original file line number Diff line number Diff line change 1
1
# Copyright The OpenTelemetry Authors
2
2
# SPDX-License-Identifier: Apache-2.0
3
3
4
- include_directories (${CMAKE_SOURCE_DIR} /exporters/ostream/include
5
- ${CMAKE_SOURCE_DIR} /ext/include ${CMAKE_SOURCE_DIR/} )
6
-
7
4
add_executable (http_client client.cc )
8
5
add_executable (http_server server.cc )
9
6
10
7
target_link_libraries (
11
- http_client ${CMAKE_THREAD_LIBS_INIT} opentelemetry_trace
12
- opentelemetry_http_client_curl opentelemetry_exporter_ostream_span
13
- ${CURL_LIBRARIES} )
8
+ http_client
9
+ PRIVATE opentelemetry-cpp::trace opentelemetry-cpp::http_client_curl
10
+ opentelemetry-cpp::ostream_span_exporter ${CURL_LIBRARIES} )
14
11
15
12
target_link_libraries (
16
- http_server ${CMAKE_THREAD_LIBS_INIT} opentelemetry_trace
17
- opentelemetry_http_client_curl opentelemetry_exporter_ostream_span )
13
+ http_server
14
+ PRIVATE opentelemetry-cpp::trace opentelemetry-cpp::http_client_curl
15
+ opentelemetry-cpp::ostream_span_exporter )
Original file line number Diff line number Diff line change 1
1
# Copyright The OpenTelemetry Authors
2
2
# SPDX-License-Identifier: Apache-2.0
3
3
4
- if (DEFINED OPENTELEMETRY_BUILD_DLL )
5
- add_definitions (-DOPENTELEMETRY_BUILD_IMPORT_DLL )
6
- endif ()
7
-
8
- include_directories (${CMAKE_SOURCE_DIR} /exporters/ostream/include )
9
-
10
4
add_executable (example_logs_simple main.cc )
11
- target_link_libraries (example_logs_simple ${CMAKE_THREAD_LIBS_INIT}
12
- common_logs_foo_library )
5
+ target_link_libraries (example_logs_simple PRIVATE common_logs_foo_library )
13
6
14
7
if (DEFINED OPENTELEMETRY_BUILD_DLL )
15
- target_link_libraries (example_logs_simple opentelemetry_cpp )
8
+ target_compile_definitions (example_logs_simple
9
+ PRIVATE OPENTELEMETRY_BUILD_IMPORT_DLL )
10
+ target_link_libraries (example_logs_simple
11
+ PRIVATE opentelemetry-cpp::opentelemetry_cpp )
16
12
else ()
17
13
target_link_libraries (
18
- example_logs_simple opentelemetry_trace opentelemetry_logs
19
- opentelemetry_exporter_ostream_span opentelemetry_exporter_ostream_logs )
14
+ example_logs_simple
15
+ PRIVATE opentelemetry-cpp::trace opentelemetry-cpp::logs
16
+ opentelemetry-cpp::ostream_span_exporter
17
+ opentelemetry-cpp::ostream_log_record_exporter )
20
18
endif ()
You can’t perform that action at this time.
0 commit comments