]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake: add module and WITH_BLKIN option for blkin
authorCasey Bodley <cbodley@redhat.com>
Mon, 17 Aug 2015 18:17:23 +0000 (14:17 -0400)
committerSage Weil <sage@redhat.com>
Fri, 5 May 2017 17:59:46 +0000 (13:59 -0400)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
CMakeLists.txt
cmake/modules/Findblkin.cmake [new file with mode: 0644]
src/include/config-h.in.cmake

index fd98fffdd1ef6dcdc509c20c9441b36e531b54d8..6ce98f65c531509ce5f51c8c1e8a0515ce069bc6 100644 (file)
@@ -337,6 +337,12 @@ find_package(dpdk)
 set(HAVE_DPDK ${DPDK_FOUND})
 endif(WITH_DPDK)
 
+option(WITH_BLKIN "Use blkin to emit LTTng tracepoints for Zipkin" OFF)
+if(WITH_BLKIN)
+  find_package(blkin REQUIRED)
+  include_directories(${BLKIN_INCLUDE_DIR})
+endif(WITH_BLKIN)
+
 #option for RGW
 option(WITH_RADOSGW "Rados Gateway is enabled" ON)
 option(WITH_RADOSGW_FCGI_FRONTEND "Rados Gateway's FCGI frontend is enabled" ON)
diff --git a/cmake/modules/Findblkin.cmake b/cmake/modules/Findblkin.cmake
new file mode 100644 (file)
index 0000000..cfa697b
--- /dev/null
@@ -0,0 +1,23 @@
+# - Try to find blkin
+# Once done this will define
+#  BLKIN_FOUND - System has blkin
+#  BLKIN_INCLUDE_DIR - The blkin include directories
+#  BLKIN_LIBRARIES - The libraries needed to use blkin
+
+find_package(PkgConfig)
+pkg_check_modules(PC_BLKIN QUIET libblkin)
+
+find_path(BLKIN_INCLUDE_DIR ztracer.hpp
+       HINTS ${PC_BLKIN_INCLUDEDIR} ${PC_BLKIN_INCLUDE_DIRS}
+       PATH_SUFFIXES blkin)
+find_library(BLKIN_LIBRARY NAMES blkin
+       HINTS ${PC_BLKIN_LIBDIR} ${PC_BLKIN_LIBRARY_DIRS})
+
+include(FindPackageHandleStandardArgs)
+# handle the QUIETLY and REQUIRED arguments and set BLKIN_FOUND to TRUE
+# if all listed variables are TRUE
+find_package_handle_standard_args(blkin DEFAULT_MSG
+       BLKIN_LIBRARY BLKIN_INCLUDE_DIR)
+
+set(BLKIN_LIBRARIES ${BLKIN_LIBRARY} lttng-ust)
+mark_as_advanced(BLKIN_INCLUDE_DIR BLKIN_LIBRARIES)
index d6768f8b666fdb617519e7f25490eb4aaf16ea24..8a903ef610836946098d0c8113689b5c170a69ca 100644 (file)
 /* Defined if pthread_setname_np() is available */
 #cmakedefine HAVE_PTHREAD_SETNAME_NP 1
 
+/* Defined if blkin enabled */
+#cmakedefine WITH_BLKIN
+
 /* Defined if pthread_set_name_np() is available */
 #cmakedefine HAVE_PTHREAD_SET_NAME_NP