From: Kefu Chai Date: Sat, 31 Jul 2021 07:49:20 +0000 (+0800) Subject: cmake: initialize dpdk_LIBRARIES with empty list X-Git-Tag: v17.1.0~1233^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ee378a34050b227677ee534161d159014f144a18;p=ceph.git cmake: initialize dpdk_LIBRARIES with empty list set(dpdk_LIBRARIES) does not reset this variable, it leaves it unchanged. if pkg-config manages to find DPDK libraries, dpdk_LIBRARIES would be set with a string like "rte_node;rte_graph;..." by pkg_check_modules(dpdk QUIET libdpdk). but we would want to set this variable to the import paths of the required libraries. so reset it before appending them to this variable. this change helps to address the build failure when building Ceph with DPDK installed into system along with its .pc file. Signed-off-by: Kefu Chai --- diff --git a/cmake/modules/Finddpdk.cmake b/cmake/modules/Finddpdk.cmake index f7b7a2d4b2fe..2cf2e6343b0e 100644 --- a/cmake/modules/Finddpdk.cmake +++ b/cmake/modules/Finddpdk.cmake @@ -72,8 +72,7 @@ set(components # for collecting dpdk library targets, it will be used when defining dpdk::dpdk set(_dpdk_libs) # for list of dpdk library archive paths -set(dpdk_LIBRARIES) - +set(dpdk_LIBRARIES "") foreach(c ${components}) set(dpdk_lib dpdk::${c}) if(TARGET ${dpdk_lib})