From: Deepika Upadhyay Date: Wed, 21 Jul 2021 15:24:30 +0000 (+0530) Subject: cmake: add find_package(thrift) support for thrift 0.13 X-Git-Tag: v17.1.0~1325^2~7 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=84ad544433b108eb87a2fe602e5ef397957913d7;p=ceph.git cmake: add find_package(thrift) support for thrift 0.13 adds Findthrift.cmake which is used to find thrift 0.13, as a dependency for building jaegertracing * bump up submodule version for jaeger-client-cpp for thrift compiler removal Signed-off-by: Deepika Upadhyay --- diff --git a/cmake/modules/Findthrift.cmake b/cmake/modules/Findthrift.cmake new file mode 100644 index 000000000000..81cdee3bea9c --- /dev/null +++ b/cmake/modules/Findthrift.cmake @@ -0,0 +1,32 @@ +# This module defines thrift_LIBRARIES, libraries to link thrift_INCLUDE_DIR, +# where to find thrift headers thrift_COMPILER, thrift compiler executable +# thrift_FOUND, If false, do not try to use it. + +# prefer the thrift version supplied in thrift_HOME (cmake -Dthrift_HOME then +# environment) +find_path( + thrift_INCLUDE_DIR + NAMES thrift/Thrift.h + HINTS ${thrift_HOME} ENV thrift_HOME /usr/local /opt/local + PATH_SUFFIXES include) + +# prefer the thrift version supplied in thrift_HOME +find_library( + thrift_LIBRARIES + NAMES thrift libthrift + HINTS ${thrift_HOME} ENV thrift_HOME /usr/local /opt/local + PATH_SUFFIXES lib lib64) + +if(thrift_FOUND AND NOT (TARGET thrift::libthrift)) + add_library(thrift::libthrift UNKNOWN IMPORTED) + + set_target_properties( + thrift::libthrift + PROPERTIES IMPORTED_LOCATION ${thrift_LIBRARIES} + INTERFACE_INCLUDE_DIRECTORIES ${thrift_INCLUDE_DIR}) +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(thrift DEFAULT_MSG thrift_LIBRARIES + thrift_INCLUDE_DIR) +mark_as_advanced(thrift_LIBRARIES thrift_INCLUDE_DIR) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9d51c2e70a68..b862da4ad700 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -442,9 +442,7 @@ if(WITH_JAEGER) 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 - ${CMAKE_BINARY_DIR}/external/lib/libopentracing.so.1.6.0 - ${CMAKE_BINARY_DIR}/external/lib/libthrift.so.0.13.0) + ${CMAKE_BINARY_DIR}/external/lib/libopentracing.so.1.6.0) install(FILES ${jaeger_libs} DESTINATION ${CMAKE_INSTALL_LIBDIR}) endif() diff --git a/src/jaegertracing/jaeger-client-cpp b/src/jaegertracing/jaeger-client-cpp index 7ad60f7330a4..95d67bf592b0 160000 --- a/src/jaegertracing/jaeger-client-cpp +++ b/src/jaegertracing/jaeger-client-cpp @@ -1 +1 @@ -Subproject commit 7ad60f7330a421fe2adcab1a2d3dbf4159af6bc2 +Subproject commit 95d67bf592b06beac718f6e69a76cd659bb51a6c