2016-08-02 15:50:13 +00:00
|
|
|
# Try to find dpdk
|
2016-02-03 10:31:45 +00:00
|
|
|
#
|
|
|
|
# Once done, this will define
|
|
|
|
#
|
|
|
|
# DPDK_FOUND
|
|
|
|
# DPDK_INCLUDE_DIR
|
|
|
|
# DPDK_LIBRARIES
|
|
|
|
|
|
|
|
find_path(DPDK_INCLUDE_DIR rte_config.h
|
2017-01-10 07:14:01 +00:00
|
|
|
PATH_SUFFIXES dpdk
|
|
|
|
HINTS $ENV{DPDK_DIR}/include)
|
2016-08-02 15:50:13 +00:00
|
|
|
|
2017-01-10 07:14:01 +00:00
|
|
|
set(components
|
|
|
|
cmdline eal ethdev hash kvargs mbuf
|
|
|
|
mempool mempool_ring mempool_stack
|
|
|
|
pmd_bond pmd_vmxnet3_uio pmd_ixgbe pmd_i40e pmd_ring pmd_af_packet
|
|
|
|
ring)
|
2016-02-03 10:31:45 +00:00
|
|
|
|
2017-01-10 07:14:01 +00:00
|
|
|
foreach(c ${components})
|
|
|
|
find_library(DPDK_rte_${c}_LIBRARY rte_${c}
|
|
|
|
HINTS $ENV{DPDK_DIR}/lib)
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
foreach(c ${components})
|
|
|
|
list(APPEND check_LIBRARIES "${DPDK_rte_${c}_LIBRARY}")
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
mark_as_advanced(DPDK_INCLUDE_DIR ${check_LIBRARIES})
|
2016-08-02 15:50:13 +00:00
|
|
|
|
|
|
|
if (EXISTS ${WITH_DPDK_MLX5})
|
|
|
|
find_library(DPDK_rte_pmd_mlx5_LIBRARY rte_pmd_mlx5)
|
|
|
|
list(APPEND check_LIBRARIES ${DPDK_rte_pmd_mlx5_LIBRARY})
|
|
|
|
mark_as_advanced(DPDK_rte_pmd_mlx5_LIBRARY)
|
|
|
|
endif()
|
2016-02-03 10:31:45 +00:00
|
|
|
|
|
|
|
include(FindPackageHandleStandardArgs)
|
|
|
|
find_package_handle_standard_args(dpdk DEFAULT_MSG
|
|
|
|
DPDK_INCLUDE_DIR
|
2016-08-02 15:50:13 +00:00
|
|
|
check_LIBRARIES)
|
2016-02-03 10:31:45 +00:00
|
|
|
|
|
|
|
if(DPDK_FOUND)
|
2017-01-10 07:14:01 +00:00
|
|
|
if(EXISTS ${WITH_DPDK_MLX5})
|
|
|
|
list(APPEND check_LIBRARIES -libverbs)
|
|
|
|
endif()
|
2016-02-03 10:31:45 +00:00
|
|
|
set(DPDK_LIBRARIES
|
2017-07-05 05:42:10 +00:00
|
|
|
-Wl,--whole-archive ${check_LIBRARIES} -Wl,--no-whole-archive)
|
2016-02-03 10:31:45 +00:00
|
|
|
endif(DPDK_FOUND)
|