--- a/extern/CMakeLists.txt
+++ b/extern/CMakeLists.txt
@@ -69,10 +69,12 @@ if(WITH_LIBMV OR WITH_GTESTS OR (WITH_CY
   if(NOT WITH_SYSTEM_GFLAGS)
     add_subdirectory(gflags)
   endif()
-  add_subdirectory(glog)
+  if(NOT WITH_SYSTEM_GLOG)
+    add_subdirectory(glog)
+  endif()
 endif()
 
-if(WITH_GTESTS)
+if(WITH_GTESTS AND NOT WITH_SYSTEM_GTESTS)
   add_subdirectory(gtest)
   add_subdirectory(gmock)
 endif()
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -481,11 +481,16 @@ option(WITH_LIBMV "Enable Libmv structur
 option(WITH_LIBMV_SCHUR_SPECIALIZATIONS "Enable fixed-size schur specializations." ON)
 mark_as_advanced(WITH_LIBMV_SCHUR_SPECIALIZATIONS)
 
+option(WITH_SYSTEM_CERES  "Use system-wide ceres-solver instead of a bundled one" OFF)
+mark_as_advanced(WITH_SYSTEM_CERES)
+
 # Logging/unit test libraries.
 option(WITH_SYSTEM_GFLAGS "Use system-wide Gflags instead of a bundled one" OFF)
 option(WITH_SYSTEM_GLOG "Use system-wide Glog instead of a bundled one" OFF)
+option(WITH_SYSTEM_TESTS    "Use system-wide Glog instead of a bundled one" OFF)
 mark_as_advanced(WITH_SYSTEM_GFLAGS)
 mark_as_advanced(WITH_SYSTEM_GLOG)
+mark_as_advanced(WITH_SYSTEM_GTESTS)
 
 # Freestyle
 option(WITH_FREESTYLE "Enable Freestyle (advanced edges rendering)" ON)
@@ -1644,6 +1649,16 @@ Define the maximum number of concurrent
   endif()
 endif()
 
+#------------------------------------------------------------------------------
+# Configure libmv
+if(WITH_LIBMV)
+  if(WITH_SYSTEM_CERES)
+    find_package(Ceres)
+    if(NOT CERES_FOUND)
+        message(FATAL_ERROR "System wide Ceres is requested but was not found")
+    endif()  
+  endif()
+endif()
 
 # -----------------------------------------------------------------------------
 # Extra Compile Flags
 
--- a/intern/libmv/CMakeLists.txt
+++ b/intern/libmv/CMakeLists.txt
@@ -33,6 +33,18 @@ if(WITH_LIBMV)
   endif()
   add_definitions(-DLIBMV_GFLAGS_NAMESPACE=${GFLAGS_NAMESPACE})
 
+  if(${WITH_SYSTEM_GFLAGS})
+    list(APPEND INC_SYS ${GFLAGS_INCLUDE_DIRS})
+  else()
+    list(APPEND INC ${GFLAGS_INCLUDE_DIRS}) 
+  endif()
+
+  if(${WITH_SYSTEM_GLOG})
+      list(APPEND INC_SYS ${GLOG_INCLUDE_DIRS})
+  else()
+      list(APPEND INC ${GLOG_INCLUDE_DIRS}) 
+  endif() 
+
   if(WITH_TBB)
     add_definitions(-DLIBMV_USE_TBB_THREADS)
   endif()
@@ -57,6 +66,23 @@ if(WITH_LIBMV)
     PRIVATE bf::dependencies::png
   )
 
+  if(NOT ${WITH_SYSTEM_CERES})
+    list(APPEND INC_SYS 
+      ../../extern/ceres/include
+      ../../extern/ceres/config
+    )
+    list(APPEND LIB
+      extern_ceres
+    )
+  else()
+    list(APPEND INC_SYS
+      ${CERES_INCLUDE_DIRS}
+    )
+    list(APPEND LIB
+      ceres
+    )
+  endif()
+
   add_definitions(
     -DWITH_LIBMV_GUARDED_ALLOC
     -DLIBMV_NO_FAST_DETECTOR=
