aboutsummaryrefslogtreecommitdiffstats
path: root/host/cmake
diff options
context:
space:
mode:
authorAlex Williams <alex.williams@ni.com>2019-11-06 11:21:32 -0800
committerMartin Braun <martin.braun@ettus.com>2019-11-26 12:21:33 -0800
commit07e04cd76015d13cbb100fc8eb61dae935fd632b (patch)
tree46bcc0ed0e139e0e139b58c5a8167820c301a617 /host/cmake
parent2d110b1deda68351fdfbf6a8b7cc0c62897d57bc (diff)
downloaduhd-07e04cd76015d13cbb100fc8eb61dae935fd632b.tar.gz
uhd-07e04cd76015d13cbb100fc8eb61dae935fd632b.tar.bz2
uhd-07e04cd76015d13cbb100fc8eb61dae935fd632b.zip
docs: Change DPDK version to 18.11 and make args use underscores
Swap out hyphens for underscores in the DPDK args. Also update list of distributions with the correct DPDK version in the repos.
Diffstat (limited to 'host/cmake')
-rw-r--r--host/cmake/Modules/FindDPDK.cmake27
1 files changed, 23 insertions, 4 deletions
diff --git a/host/cmake/Modules/FindDPDK.cmake b/host/cmake/Modules/FindDPDK.cmake
index 53ecf1112..a5029b94c 100644
--- a/host/cmake/Modules/FindDPDK.cmake
+++ b/host/cmake/Modules/FindDPDK.cmake
@@ -24,6 +24,11 @@ find_path ( DPDK_INCLUDE_ETHDEV_DIR rte_ethdev.h
PATH_SUFFIXES dpdk
)
+find_path ( DPDK_INCLUDE_VERSION_DIR rte_version.h
+ PATHS ENV RTE_INCLUDE
+ PATH_SUFFIXES dpdk
+)
+
set(DPDK_INCLUDE_DIR ${DPDK_INCLUDE_CONFIG_DIR} ${DPDK_INCLUDE_ETHDEV_DIR})
list(REMOVE_DUPLICATES DPDK_INCLUDE_DIR)
@@ -33,8 +38,22 @@ find_library(DPDK_LIBRARY
list(APPEND DPDK_LIBRARIES dpdk)
-find_package_handle_standard_args(dpdk
- DEFAULT_MSG
- DPDK_INCLUDE_DIR
- DPDK_LIBRARIES
+if(DPDK_INCLUDE_VERSION_DIR)
+ file(READ "${DPDK_INCLUDE_VERSION_DIR}/rte_version.h"
+ DPDK_VERSION_STR
+ )
+
+ string(REGEX MATCH "#define RTE_VER_YEAR ([0-9]+)" _ ${DPDK_VERSION_STR})
+ set(DPDK_VERSION_MAJOR ${CMAKE_MATCH_1})
+
+ string(REGEX MATCH "#define RTE_VER_MONTH ([0-9]+)" _ ${DPDK_VERSION_STR})
+ set(DPDK_VERSION_MINOR ${CMAKE_MATCH_1})
+endif(DPDK_INCLUDE_VERSION_DIR)
+
+
+set(DPDK_VERSION "${DPDK_VERSION_MAJOR}.${DPDK_VERSION_MINOR}")
+
+find_package_handle_standard_args(DPDK
+ REQUIRED_VARS DPDK_INCLUDE_DIR DPDK_LIBRARIES
+ VERSION_VAR DPDK_VERSION
)