]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
cmake: add Find{dpdk,pciaccess}.cmake
authorKefu Chai <kchai@redhat.com>
Wed, 3 Feb 2016 10:31:45 +0000 (18:31 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 4 Feb 2016 06:03:21 +0000 (14:03 +0800)
to ready the SPDK support

Signed-off-by: Kefu Chai <kchai@redhat.com>
cmake/modules/Finddpdk.cmake [new file with mode: 0644]
cmake/modules/Findpciaccess.cmake [new file with mode: 0644]

diff --git a/cmake/modules/Finddpdk.cmake b/cmake/modules/Finddpdk.cmake
new file mode 100644 (file)
index 0000000..4c908d5
--- /dev/null
@@ -0,0 +1,33 @@
+# Try to find spdk
+#
+# Once done, this will define
+#
+# DPDK_FOUND
+# DPDK_INCLUDE_DIR
+# DPDK_LIBRARIES
+
+find_path(DPDK_INCLUDE_DIR rte_config.h
+  PATH_SUFFIXES dpdk)
+find_library(DPDK_rte_eal_LIBRARY rte_eal)
+find_library(DPDK_rte_mempool_LIBRARY rte_mempool)
+find_library(DPDK_rte_ring_LIBRARY rte_ring)
+
+mark_as_advanced(DPDK_INCLUDE_DIR
+  DPDK_rte_eal_LIBRARY
+  DPDK_rte_mempool_LIBRARY
+  DPDK_rte_ring_LIBRARY)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(dpdk DEFAULT_MSG
+  DPDK_INCLUDE_DIR
+  DPDK_rte_eal_LIBRARY
+  DPDK_rte_mempool_LIBRARY
+  DPDK_rte_ring_LIBRARY)
+
+if(DPDK_FOUND)
+  set(DPDK_LIBRARIES
+    ${DPDK_rte_eal_LIBRARY}
+    ${DPDK_rte_mempool_LIBRARY}
+    ${DPDK_rte_ring_LIBRARY})
+endif(DPDK_FOUND)
+
diff --git a/cmake/modules/Findpciaccess.cmake b/cmake/modules/Findpciaccess.cmake
new file mode 100644 (file)
index 0000000..6e5bd52
--- /dev/null
@@ -0,0 +1,15 @@
+# Try to find pciaccess
+#
+# Once done, this will define
+#
+# PCIACCESS_FOUND
+# PCIACCESS_INCLUDE_DIR
+# PCIACCESS_LIBRARIES
+
+find_path(PCIACCESS_INCLUDE_DIR pciaccess.h)
+find_library(PCIACCESS_LIBRARIES pciaccess)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(PCIACCESS DEFAULT_MSG PCIACCESS_LIBRARIES PCIACCESS_INCLUDE_DIR)
+
+mark_as_advanced(PCIACCESS_INCLUDE_DIR PCIACCESS_LIBRARIES)