From 9d7d80158fba59ece9f3edff0145a479ded8a7b4 Mon Sep 17 00:00:00 2001 From: Edouard Griffiths Date: Sat, 5 Feb 2022 12:04:34 +0100 Subject: [PATCH] Allow VS2022 in MSVC build --- CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 24a024be2..3c9adff01 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -201,10 +201,12 @@ elseif (WIN32) set(VS2017 ON) elseif(MSVC_VERSION GREATER 1899 AND MSVC_VERSION LESS 1910) set(VS2015 ON) + elseif(MSVC_VERSION GREATER 1930) + set(VS2022 ON) endif() - if(NOT VS2015 AND NOT VS2017 AND NOT VS2019) - message(FATAL_ERROR "You must use Microsoft Visual Studio 2015, 2017 or 2019 as compiler") + if(NOT VS2015 AND NOT VS2017 AND NOT VS2019 AND NOT VS2022) + message(FATAL_ERROR "You must use Microsoft Visual Studio 2015, 2017, 2019 or greater as compiler") endif() # in alternative we can use ExternalProject