From: Kefu Chai Date: Wed, 3 Feb 2016 10:31:45 +0000 (+0800) Subject: cmake: add Find{dpdk,pciaccess}.cmake X-Git-Tag: v10.0.4~45^2~4 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=8c2bb7e5c613a1cb426ec538bb00d816dd5fa7b6;p=ceph-ci.git cmake: add Find{dpdk,pciaccess}.cmake to ready the SPDK support Signed-off-by: Kefu Chai --- diff --git a/cmake/modules/Finddpdk.cmake b/cmake/modules/Finddpdk.cmake new file mode 100644 index 00000000000..4c908d50e39 --- /dev/null +++ b/cmake/modules/Finddpdk.cmake @@ -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 index 00000000000..6e5bd52b01f --- /dev/null +++ b/cmake/modules/Findpciaccess.cmake @@ -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)