From 843290e2a502554d42c2a686bf1efb96a1eaa5d9 Mon Sep 17 00:00:00 2001 From: ptaylor Date: Fri, 2 Jul 2021 22:55:35 -0500 Subject: [PATCH] always add faiss library alias if it's missing --- cpp/cmake/thirdparty/get_faiss.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cpp/cmake/thirdparty/get_faiss.cmake b/cpp/cmake/thirdparty/get_faiss.cmake index 626af5196c..8a88f9694e 100644 --- a/cpp/cmake/thirdparty/get_faiss.cmake +++ b/cpp/cmake/thirdparty/get_faiss.cmake @@ -40,7 +40,10 @@ function(find_and_configure_faiss) if(FAISS_ADDED) target_include_directories(faiss INTERFACE $) - add_library(FAISS::FAISS ALIAS faiss) + endif() + + if(TARGET faiss AND NOT TARGET FAISS::FAISS) + add_library(FAISS::FAISS ALIAS faiss) endif() endfunction()