--- ceres-solver-1.12.0/cmake/FindSuiteSparse.cmake.orig	2016-12-05 18:45:15.000000000 +0300
+++ ceres-solver-1.12.0/cmake/FindSuiteSparse.cmake	2017-01-16 09:34:38.252778400 +0300
@@ -198,16 +198,22 @@
 # of all variables that must be defined for SuiteSparse to be considered found.
 unset(SUITESPARSE_FOUND_REQUIRED_VARS)
 
-# BLAS.
-find_package(BLAS QUIET)
+# OpenBLAS or (BLAS and LAPACK)
+find_package(OpenBLAS QUIET)
+if (DEFINED OpenBLAS_LIBRARIES)
+  set(LAPACK_FOUND "YES")
+  set(BLAS_FOUND "YES")
+else (DEFINED OpenBLAS_LIBRARIES)
+  find_package(LAPACK QUIET)
+  find_package(BLAS QUIET)
+endif (DEFINED OpenBLAS_LIBRARIES)
+  
 if (NOT BLAS_FOUND)
   suitesparse_report_not_found(
     "Did not find BLAS library (required for SuiteSparse).")
 endif (NOT BLAS_FOUND)
 list(APPEND SUITESPARSE_FOUND_REQUIRED_VARS BLAS_FOUND)
 
-# LAPACK.
-find_package(LAPACK QUIET)
 if (NOT LAPACK_FOUND)
   suitesparse_report_not_found(
     "Did not find LAPACK library (required for SuiteSparse).")
--- ceres-solver-1.12.0/CMakeLists.txt.orig	2016-12-05 18:45:15.000000000 +0300
+++ ceres-solver-1.12.0/CMakeLists.txt	2017-01-16 09:39:03.776508400 +0300
@@ -245,7 +245,19 @@
 endif (EIGEN_FOUND)
 
 if (LAPACK)
-  find_package(LAPACK QUIET)
+  find_package(OpenBLAS QUIET)
+  if (DEFINED OpenBLAS_LIBRARIES)
+    set(LAPACK_FOUND "YES")
+    set(LAPACK_INCLUDE_DIRS ${OpenBLAS_INCLUDE_DIRS})
+    set(LAPACK_LIBRARIES ${OpenBLAS_LIBRARIES})
+    set(BLAS_FOUND "YES")
+    set(BLAS_INCLUDE_DIRS ${OpenBLAS_INCLUDE_DIRS})
+    set(BLAS_LIBRARIES ${OpenBLAS_LIBRARIES})
+  else (DEFINED OpenBLAS_LIBRARIES)
+    find_package(LAPACK QUIET)
+    find_package(BLAS QUIET)
+  endif (DEFINED OpenBLAS_LIBRARIES)
+
   if (LAPACK_FOUND)
     message("-- Found LAPACK library: ${LAPACK_LIBRARIES}")
   else (LAPACK_FOUND)
@@ -800,7 +811,7 @@
 
 # Set the install path for the installed CeresConfig.cmake configuration file
 # relative to CMAKE_INSTALL_PREFIX.
-if (WIN32)
+if (MSVC)
   set(RELATIVE_CMAKECONFIG_INSTALL_DIR CMake)
 else ()
   set(RELATIVE_CMAKECONFIG_INSTALL_DIR lib${LIB_SUFFIX}/cmake/Ceres)
