]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake: add find_package(thrift) support for thrift 0.13
authorDeepika Upadhyay <dupadhya@redhat.com>
Wed, 21 Jul 2021 15:24:30 +0000 (20:54 +0530)
committerDeepika Upadhyay <dupadhya@redhat.com>
Thu, 22 Jul 2021 05:29:48 +0000 (10:59 +0530)
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 <dupadhya@redhat.com>
cmake/modules/Findthrift.cmake [new file with mode: 0644]
src/CMakeLists.txt
src/jaegertracing/jaeger-client-cpp

diff --git a/cmake/modules/Findthrift.cmake b/cmake/modules/Findthrift.cmake
new file mode 100644 (file)
index 0000000..81cdee3
--- /dev/null
@@ -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)
index 9d51c2e70a688fa826e3b8e98d38307b9d75246a..b862da4ad700ef71e247c3698577605555afdd95 100644 (file)
@@ -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()
index 7ad60f7330a421fe2adcab1a2d3dbf4159af6bc2..95d67bf592b06beac718f6e69a76cd659bb51a6c 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 7ad60f7330a421fe2adcab1a2d3dbf4159af6bc2
+Subproject commit 95d67bf592b06beac718f6e69a76cd659bb51a6c