From: Kefu Chai Date: Sat, 3 Apr 2021 13:59:05 +0000 (+0800) Subject: cmake: dedup components when finding pmem X-Git-Tag: v17.1.0~2363^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=37a015a9eded393813b529ba6e5c06b3f3da2b9e;p=ceph.git cmake: dedup components when finding pmem otherwise we always find libpmem twice if libpmem is explicitly specified when find_package() Signed-off-by: Kefu Chai --- diff --git a/cmake/modules/Findpmem.cmake b/cmake/modules/Findpmem.cmake index def31cb1ff28..1f6e9eab0f55 100644 --- a/cmake/modules/Findpmem.cmake +++ b/cmake/modules/Findpmem.cmake @@ -6,7 +6,11 @@ find_package(PkgConfig QUIET REQUIRED) -foreach(component pmem ${pmem_FIND_COMPONENTS}) +# all pmem libraries depend on pmem, so always find it +set(pmem_FIND_COMPONENTS ${pmem_FIND_COMPONENTS} pmem) +list(REMOVE_DUPLICATES pmem_FIND_COMPONENTS) + +foreach(component ${pmem_FIND_COMPONENTS}) set(pmem_COMPONENTS pmem pmemobj) list(FIND pmem_COMPONENTS "${component}" found) if(found EQUAL -1)