Merge pull request #307098 from r-ryantm/auto-update/cilium-cli
[NixPkgs.git] / pkgs / development / python-modules / opensfm / 0002-cmake-find-system-distributed-gtest.patch
blob27b87c0b2d099641392a792f9010abcafcc80c44
1 From 79577371be21df40f1f6d4a4fe3453be6df9e93c Mon Sep 17 00:00:00 2001
2 From: Someone Serge <sergei.kozlukov@aalto.fi>
3 Date: Fri, 31 Dec 2021 10:03:25 +0200
4 Subject: [PATCH 2/4] cmake: find system-distributed gtest
6 ---
7 opensfm/src/CMakeLists.txt | 19 +++++++------------
8 1 file changed, 7 insertions(+), 12 deletions(-)
10 diff --git a/opensfm/src/CMakeLists.txt b/opensfm/src/CMakeLists.txt
11 index c85aa6fb..640d47a6 100644
12 --- a/opensfm/src/CMakeLists.txt
13 +++ b/opensfm/src/CMakeLists.txt
14 @@ -52,12 +52,14 @@ if (OPENMP_FOUND)
15 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
16 endif()
18 +find_package(gflags REQUIRED)
20 find_package(LAPACK)
21 find_package(SuiteSparse)
22 find_package(Eigen3 REQUIRED)
23 find_package(Ceres)
24 -find_package(Gflags REQUIRED)
25 -find_package(Glog REQUIRED)
26 +find_package(glog REQUIRED)
27 +find_package(GTest REQUIRED)
29 # Ceres2 exposes Ceres::ceres target.
30 # Ceres1 exposes just ceres.
31 @@ -100,20 +102,13 @@ option(OPENSFM_BUILD_TESTS "Build OpenSfM unit tests." on)
33 if (OPENSFM_BUILD_TESTS)
34 enable_testing()
35 - include_directories(third_party/gtest)
36 - add_definitions(-DCERES_GFLAGS_NAMESPACE=${GFLAGS_NAMESPACE})
38 - add_library(gtest
39 - third_party/gtest/gmock_gtest_all.cc
40 - third_party/gtest/gmock_main.cc)
41 - target_include_directories(gtest PRIVATE ${GFLAGS_INCLUDE_DIR})
43 set(TEST_MAIN test_main)
44 add_library(${TEST_MAIN} testing_main.cc)
45 target_link_libraries(${TEST_MAIN}
46 - ${GFLAGS_LIBRARY}
47 - ${GLOG_LIBRARY}
48 - gtest)
49 + gflags
50 + glog::glog
51 + GTest::gtest)
52 endif()
54 ####### OpenSfM libraries #######
55 --
56 2.33.1