* extract `do_export_dpdk()` into a separated function
* no need to check for `dpdk-ext` target before calling `build_dpdk()`,
as the name of this target should be hidden from the caller of this
function.
Signed-off-by: Kefu Chai <kchai@redhat.com>
option(WITH_DPDK "Enable DPDK messaging" OFF)
if(WITH_DPDK)
find_package(dpdk)
- if(NOT DPDK_FOUND AND NOT TARGET dpdk-ext)
+ if(NOT DPDK_FOUND)
include(BuildDPDK)
build_dpdk(${CMAKE_BINARY_DIR}/src/dpdk)
endif()
ExternalProject_Add_StepTargets(dpdk-ext configure patch-config build)
endfunction()
-function(build_dpdk dpdk_dir)
- do_build_dpdk(${dpdk_dir})
+function(do_export_dpdk dpdk_dir)
set(DPDK_INCLUDE_DIR ${dpdk_dir}/include)
# create the directory so cmake won't complain when looking at the imported
# target
INTERFACE_COMPILE_OPTIONS "${dpdk_rte_CFLAGS}")
endif()
endfunction()
+
+function(build_dpdk dpdk_dir)
+ if(NOT TARGET dpdk-ext)
+ do_build_dpdk(${dpdk_dir})
+ endif()
+ if(NOT TARGET dpdk::dpdk)
+ do_export_dpdk(${dpdk_dir})
+ endif()
+endfunction()