We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
-DWITH_OTLP=ON -DCMAKE_FIND_ROOT_PATH=<PROTOBUF INSTALL PREFIX DIR>
1 parent 7e06316 commit 65da5fdCopy full SHA for 65da5fd
1 file changed
cmake/opentelemetry-proto.cmake
@@ -132,6 +132,19 @@ add_library(
132
${METRICS_SERVICE_PB_CPP_FILE}
133
${METRICS_SERVICE_GRPC_PB_CPP_FILE})
134
135
+if(TARGET protobuf::libprotobuf)
136
+ target_link_libraries(opentelemetry_proto
137
+ PUBLIC protobuf::libprotobuf
138
+ )
139
+else() # cmake 3.8 or lower
140
+ target_include_directories(opentelemetry_proto
141
+ PUBLIC ${Protobuf_INCLUDE_DIRS}
142
143
144
+ INTERFACE ${Protobuf_LIBRARIES}
145
146
+endif()
147
+
148
if(BUILD_SHARED_LIBS)
149
set_property(TARGET opentelemetry_proto PROPERTY POSITION_INDEPENDENT_CODE ON)
150
endif()
0 commit comments