Replace (MSVC/GCC/CLANG)_VERSION with CMAKE_CXX_COMPILER_VERSION.

- As raised in issue #377, GCC_VERSION is not always defined, in which
  case we were not enabling compiler optimisations.
- CMAKE_CXX_COMPILER_VERSION is the more modern, uniform method to
  verify the compiler version.
- Also removes legacy Apple-GCC (i.e. Apple's fork of GCC prior to their
  switch to Clang) logic, and Xcode 4.x logic (in June 2018, Xcode 9.x
  is the current version).
- Also removes addition of -march=native on Linux (was not added for
  OS X).  If users wish to append -march=native (which will affect the
  portability of the resulting output) they can do so manually as now
  explained in the docs.
- Fixes check for Clang on OS X.  As per CMP0025 (CMake 3.0+)
  CMAKE_CXX_COMPILER_ID reports AppleClang on OS X, not Clang. Thus
  using: if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") would fail for
  AppleClang.  Instead, MATCHES should be used instead of STREQUAL to
  support both Clang & AppleClang.

Change-Id: I9647030b76f4b85a9ef2deea82d80ed79812ae33
2 files changed
tree: 8fb8decc09361dfeb93045fab1ee6e5575742a5b
  1. bazel/
  2. cmake/
  3. config/
  4. data/
  5. docs/
  6. examples/
  7. include/
  8. internal/
  9. jni/
  10. scripts/
  11. .gitignore
  12. BUILD
  13. CMakeLists.txt
  14. LICENSE
  15. package.xml
  16. README.md
  17. WORKSPACE
README.md

Ceres Solver

Ceres Solver is an open source C++ library for modeling and solving large, complicated optimization problems. It is a feature rich, mature and performant library which has been used in production at Google since 2010. Ceres Solver can solve two kinds of problems.

  1. Non-linear Least Squares problems with bounds constraints.
  2. General unconstrained optimization problems.

Please see ceres-solver.org for more information.

WARNING - Do not make GitHub pull requests!

Ceres development happens on Gerrit, including both repository hosting and code reviews. The GitHub Repository is a continuously updated mirror which is primarily meant for issue tracking. Please see our Contributing to Ceres Guide for more details.

The upstream Gerrit repository is

https://ceres-solver.googlesource.com/ceres-solver