summaryrefslogtreecommitdiff
path: root/gnu/packages/patches/faiss-tests-CMakeLists-find-googletest.patch
blob: 5183bac08a6c1c51ef68c0c6131581b8cf274f98 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
From 9f845321de3bdd2b840c42b977c1c092ac553cc2 Mon Sep 17 00:00:00 2001
From: Nicolas Graves <[email protected]>
Date: Fri, 21 Feb 2025 12:05:59 +0100
Subject: [PATCH] tests/CMakeLists.txt: Find googletest package from inputs

---
 tests/CMakeLists.txt | 29 +----------------------------
 1 file changed, 1 insertion(+), 28 deletions(-)

diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index dfab76e0..16a51b0b 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -48,35 +48,8 @@ if (FAISS_ENABLE_PYTHON)
   target_link_libraries(faiss_test PUBLIC faiss_example_external_module)
 endif()
 
-include(FetchContent)
-FetchContent_Declare(
-  googletest
-  GIT_REPOSITORY https://github.com/google/googletest.git
-  GIT_TAG 58d77fa8070e8cec2dc1ed015d66b454c8d78850 # release-1.12.1
-  OVERRIDE_FIND_PACKAGE)
-set(BUILD_GMOCK CACHE BOOL OFF)
-set(INSTALL_GTEST CACHE BOOL OFF)
-FetchContent_MakeAvailable(googletest)
-
-if(NOT EXISTS ${CMAKE_FIND_PACKAGE_REDIRECTS_DIR}/gtest-config.cmake
-   AND NOT EXISTS ${CMAKE_FIND_PACKAGE_REDIRECTS_DIR}/GTestConfig.cmake)
-  file(
-    WRITE ${CMAKE_FIND_PACKAGE_REDIRECTS_DIR}/gtest-config.cmake
-    [=[
-include(CMakeFindDependencyMacro)
-find_dependency(googletest)
-if(NOT TARGET GTest::GTest)
-  add_library(GTest::GTest INTERFACE IMPORTED)
-  target_link_libraries(GTest::GTest INTERFACE GTest::gtest)
-endif()
-if(NOT TARGET GTest::Main)
-  add_library(GTest::Main INTERFACE IMPORTED)
-  target_link_libraries(GTest::Main INTERFACE GTest::gtest_main)
-endif()
-]=])
-endif()
-
 find_package(OpenMP REQUIRED)
+find_package(GTest REQUIRED)
 find_package(GTest CONFIG REQUIRED)
 
 target_link_libraries(faiss_test PRIVATE
-- 
2.48.1