cmake: add support for Visual Studio 2019

This commit is contained in:
Davide Gerhard 2021-04-08 13:09:15 +02:00
parent 7d3c1d100e
commit 9fd7bf2ee0
2 changed files with 5 additions and 3 deletions

View File

@ -157,8 +157,8 @@ elseif(APPLE)
message(STATUS "RPATH support: ${CMAKE_MACOSX_RPATH}")
elseif (WIN32)
if(NOT VS2015 AND NOT VS2017)
message(FATAL_ERROR "You must use Microsoft Visual Studio 2015 or 2017 as compiler")
if(NOT VS2015 AND NOT VS2017 AND NOT VS2019)
message(FATAL_ERROR "You must use Microsoft Visual Studio 2015, 2017 or 2019 as compiler")
endif()
# compile with full multicore

View File

@ -5,7 +5,9 @@ elseif(NOT DEFINED C_GCC AND CMAKE_CXX_COMPILER_ID MATCHES "GNU")
set(C_GCC 1)
elseif(NOT DEFINED C_MSVC AND CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
set(C_MSVC 1)
if(MSVC_VERSION GREATER 1910 AND MSVC_VERSION LESS 1919)
if(MSVC_VERSION GREATER_EQUAL 1920 AND MSVC_VERSION LESS_EQUAL 1929)
set(VS2019 ON)
elseif(MSVC_VERSION GREATER_EQUAL 1910 AND MSVC_VERSION LESS_EQUAL 1919)
set(VS2017 ON)
elseif(MSVC_VERSION GREATER 1899 AND MSVC_VERSION LESS 1910)
set(VS2015 ON)