File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,12 @@ if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
99 project (opentelemetry-geneva-metrics)
1010 set (MAIN_PROJECT ON )
1111endif ()
12+ option (OTELCPP_VERSIONED_LIBS "Whether to generate the versioned shared libs"
13+ OFF )
14+ if (OTELCPP_VERSIONED_LIBS AND NOT BUILD_SHARED_LIBS )
15+ message (FATAL_ERROR "OTELCPP_VERSIONED_LIBS=ON requires BUILD_SHARED_LIBS=ON" )
16+ endif ()
17+
1218
1319if (NOT WIN32 )
1420 find_package (CURL REQUIRED)
@@ -21,6 +27,17 @@ endif()
2127
2228include_directories (include )
2329
30+ set (OTEL_GENEVA_EXPORTER_VERSION 1.0.0)
31+ set (OTEL_GENEVA_EXPORTER_MAJOR_VERSION 1)
32+
33+ function (set_target_version target_name)
34+ if (OTELCPP_VERSIONED_LIBS)
35+ set_target_properties (
36+ ${target_name} PROPERTIES VERSION ${OTEL_GENEVA_EXPORTER_VERSION}
37+ SOVERSION ${OTEL_GENEVA_EXPORTER_MAJOR_VERSION} )
38+ endif ()
39+ endfunction ()
40+
2441# create geneva metrics exporter
2542if (WIN32 )
2643 add_library (
@@ -44,6 +61,8 @@ endif()
4461
4562set_target_properties (opentelemetry_exporter_geneva_metrics
4663 PROPERTIES EXPORT_NAME metrics)
64+ set_target_version(opentelemetry_exporter_geneva_metrics)
65+
4766if (BUILD_TESTING)
4867 if (EXISTS ${CMAKE_BINARY_DIR} /lib/libgtest.a)
4968 # Prefer GTest from build tree. GTest is not always working with
You can’t perform that action at this time.
0 commit comments