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
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}")
18 +find_package(gflags REQUIRED)
21 find_package(SuiteSparse)
22 find_package(Eigen3 REQUIRED)
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)
35 - include_directories(third_party/gtest)
36 - add_definitions(-DCERES_GFLAGS_NAMESPACE=${GFLAGS_NAMESPACE})
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}
54 ####### OpenSfM libraries #######