Commit ac2d2a78 authored by Davis King's avatar Davis King

Improved check for old visual studio

parent 0eb92bbe
...@@ -18,6 +18,9 @@ set(COMPILER_CAN_DO_CPP_11 0) ...@@ -18,6 +18,9 @@ set(COMPILER_CAN_DO_CPP_11 0)
include(${CMAKE_CURRENT_LIST_DIR}/add_global_compiler_switch.cmake) include(${CMAKE_CURRENT_LIST_DIR}/add_global_compiler_switch.cmake)
if(MSVC AND MSVC_VERSION VERSION_LESS 1900)
message(FATAL_ERROR "C++11 is required to use dlib, but the version of Visual Studio you are using is too old and doesn't support C++11. You need Visual Studio 2015 or newer. ")
endif()
# Now turn on the appropriate compiler switch to enable C++11 if you have a # Now turn on the appropriate compiler switch to enable C++11 if you have a
# C++11 compiler. In CMake 3.1 there is a simple flag you can set, but earlier # C++11 compiler. In CMake 3.1 there is a simple flag you can set, but earlier
...@@ -50,8 +53,6 @@ if (CMAKE_VERSION VERSION_LESS "3.1.2") ...@@ -50,8 +53,6 @@ if (CMAKE_VERSION VERSION_LESS "3.1.2")
message(FATAL_ERROR "*** Your compiler failed to build a C++11 project, so dlib won't use C++11 features.***") message(FATAL_ERROR "*** Your compiler failed to build a C++11 project, so dlib won't use C++11 features.***")
endif() endif()
endif() endif()
elseif(MSVC AND MSVC_VERSION VERSION_LESS 1900)
message(FATAL_ERROR "C++11 is required to use dlib, but the version of Visual Studio you are using is too old and doesn't support C++11.")
elseif(MSVC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.0.24215.1 ) elseif(MSVC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.0.24215.1 )
message(STATUS "NOTE: Visual Studio didn't have good enough C++11 support until Visual Studio 2015 update 3 (v19.0.24215.1)") message(STATUS "NOTE: Visual Studio didn't have good enough C++11 support until Visual Studio 2015 update 3 (v19.0.24215.1)")
message(STATUS "So we aren't enabling things that require full C++11 support (e.g. the deep learning tools).") message(STATUS "So we aren't enabling things that require full C++11 support (e.g. the deep learning tools).")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment