Cleanup gcc version checking code a little.

Also fix this error from cmake 3.5.1:

```
CMake Error at CMakeLists.txt:62 (if):
  if given arguments:

    "CMAKE_COMPILER_IS_GNUCXX" "AND" "CMAKE_CXX_COMPILER_VERSION" "VERSION_LESS_EQUAL" "4.8.5"

  Unknown arguments specified
```
pull/2365/head
Davis King 3 years ago
parent 8e9755ab0f
commit ded68b9af7

@ -58,11 +58,6 @@ if(has_parent)
endif()
endif()
# As of dlib 19.22, GCC 4.8.5 is no longer supported, building will fail, so let users know.
if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS_EQUAL 4.8.5)
message(FATAL_ERROR "${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_VERSION} is too old for dlib ${VERSION}.\n\
Either update your compiler to be fully compliant with C++11 or build an older version of dlib, such as 19.21.")
endif()
if (COMMAND pybind11_add_module AND MSVC)
# True when building a python extension module using Visual Studio. We care

@ -46,8 +46,8 @@ endif()
if(CMAKE_COMPILER_IS_GNUCXX)
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
if (GCC_VERSION VERSION_LESS 4.8)
message(FATAL_ERROR "C++11 is required to use dlib, but the version of GCC you are using is too old and doesn't support C++11. You need GCC 4.8 or newer. ")
if (GCC_VERSION VERSION_LESS 4.9)
message(FATAL_ERROR "C++11 is required to use dlib, but the version of GCC you are using is too old and doesn't support C++11. You need GCC 4.9 or newer. ")
endif()
endif()

Loading…
Cancel
Save