CMake: check for minimum MSVC version
authorCampbell Barton <ideasman42@gmail.com>
Wed, 24 Feb 2016 20:31:44 +0000 (07:31 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 24 Feb 2016 20:31:44 +0000 (07:31 +1100)
Needed since older versions are unsupported (giving cryptic errors).

CMakeLists.txt

index 28c962e0d55902a9ff976b3653cea975c88ed15f..5efd57c32d3f0a3d19ec0a87378674d5670d8a2f 100644 (file)
@@ -1242,6 +1242,14 @@ elseif(WIN32)
        add_definitions(-DWIN32)
 
        if(MSVC)
+               # Minimum MSVC Version
+               set(_min_ver "18.0.31101")
+               if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${_min_ver})
+                       message(FATAL_ERROR
+                               "Visual Studio 2013 (Update 4, ${_min_ver}) required, "
+                               "found (${CMAKE_CXX_COMPILER_VERSION})")
+               endif()
+               unset(_min_ver)
 
                # needed for some MSVC installations
                set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH:NO")