From 5f5de4ccb597991b1edae43562c30bdb9dba12ac Mon Sep 17 00:00:00 2001 From: Deepika Upadhyay Date: Wed, 21 Jul 2021 21:41:37 +0530 Subject: [PATCH] cmake: fix jaeger linking to ceph libraries updates: * custom target jaeger_base * target jaeger-base which encapsulates all jaeger libs * include external libraries path needed linking libraries and including opentracing and jaegertracing headers files Signed-off-by: Deepika Upadhyay --- src/CMakeLists.txt | 19 +++++++++++-------- src/os/CMakeLists.txt | 1 + 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e0ecb15b1e618..12ef955b87f1d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -434,15 +434,18 @@ if(WITH_JAEGER) build_jaeger() + include_directories(${CMAKE_BINARY_DIR}/external/include) + # for testing jaeger build + add_custom_target(jaeger_base DEPENDS ${jaeger_base}) + add_library(jaeger-base INTERFACE) + add_dependencies(common-objs ${jaeger_base}) target_link_libraries(jaeger-base INTERFACE - yaml-cpp::yaml-cpp - opentracing::libopentracing - thrift::libthrift - jaegertracing::libjaegertracing) - include_directories(SYSTEM ${CMAKE_BINARY_DIR}/external/include) - #with CMake 3.12+ the following can be replaced by: - #target_link_libraries(common-objs jaeger-base) - list(APPEND jaeger_libs + yaml-cpp::yaml-cpp + opentracing::libopentracing + thrift::libthrift + jaegertracing::libjaegertracing) + + list(APPEND jaeger_libs ${CMAKE_BINARY_DIR}/external/lib/libjaegertracing.so.0 ${CMAKE_BINARY_DIR}/external/lib/libjaegertracing.so.0.6.1 ${CMAKE_BINARY_DIR}/external/lib/libopentracing.so.1.6.0) diff --git a/src/os/CMakeLists.txt b/src/os/CMakeLists.txt index d31b4c70cc596..377360f9af688 100644 --- a/src/os/CMakeLists.txt +++ b/src/os/CMakeLists.txt @@ -93,6 +93,7 @@ if(WITH_LTTNG) endif() if(WITH_JAEGER) + add_dependencies(os jaeger-base) target_link_libraries(os jaeger-base) endif() -- 2.39.5