summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-06-24 20:12:31 (GMT)
committerBrad King <brad.king@kitware.com>2021-06-25 16:45:44 (GMT)
commitc46b265839c408ba04edc6ae7c96bc257547f43c (patch)
tree30172385edacef220a835c568e73513ff4ccd4a5 /Tests
parentb610b7a35cd62ce180ef3f5be4fabd9336f3fe51 (diff)
downloadCMake-c46b265839c408ba04edc6ae7c96bc257547f43c.zip
CMake-c46b265839c408ba04edc6ae7c96bc257547f43c.tar.gz
CMake-c46b265839c408ba04edc6ae7c96bc257547f43c.tar.bz2
VS: Add Visual Studio 17 2022 generator
Fixes: #22339
Diffstat (limited to 'Tests')
-rw-r--r--Tests/CMakeLists.txt8
-rw-r--r--Tests/RunCMake/CommandLine/RunCMakeTest.cmake2
-rw-r--r--Tests/RunCMake/GeneratorPlatform/RunCMakeTest.cmake4
-rw-r--r--Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake10
-rw-r--r--Tests/RunCMake/GeneratorToolset/TestToolsetHostArchNone.cmake2
-rw-r--r--Tests/VSExternalInclude/CMakeLists.txt4
6 files changed, 18 insertions, 12 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 6d73554..341aba6 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -209,9 +209,12 @@ if(BUILD_TESTING)
if(CMAKE_HOST_WIN32 AND COMMAND cmake_host_system_information)
set(info_vs15 "VS_15_DIR")
set(info_vs16 "VS_16_DIR")
+ set(info_vs17 "VS_17_DIR")
set(vs_versions)
if(WIN32)
- if(NOT CMAKE_VERSION VERSION_LESS 3.14)
+ if(NOT CMAKE_VERSION VERSION_LESS 3.21.20210624)
+ set(vs_versions vs15 vs16 vs17)
+ elseif(NOT CMAKE_VERSION VERSION_LESS 3.14)
set(vs_versions vs15 vs16)
elseif(NOT CMAKE_VERSION VERSION_LESS 3.8)
set(vs_versions vs15)
@@ -2459,6 +2462,9 @@ if(BUILD_TESTING)
if(vs16 AND CMake_TEST_ANDROID_VS16)
add_test_VSAndroid(vs16 "Visual Studio 16 2019" "ARM")
endif()
+ if(vs17 AND CMake_TEST_ANDROID_VS17)
+ add_test_VSAndroid(vs17 "Visual Studio 17 2022" "ARM")
+ endif()
if (APPLE)
if (CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
index c4d3e4a..c58b1d0 100644
--- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
@@ -313,7 +313,7 @@ function(run_EnvironmentGenerator)
unset(ENV{CMAKE_GENERATOR_PLATFORM})
endif()
# Instance is available since VS 2017.
- if(RunCMake_GENERATOR MATCHES "Visual Studio (15|16).*")
+ if(RunCMake_GENERATOR MATCHES "Visual Studio 1[567].*")
set(ENV{CMAKE_GENERATOR_INSTANCE} "invalid")
# Envvar shouldn't affect existing build tree
run_cmake_command(Envgen-instance-existing ${CMAKE_COMMAND} -E chdir ..
diff --git a/Tests/RunCMake/GeneratorPlatform/RunCMakeTest.cmake b/Tests/RunCMake/GeneratorPlatform/RunCMakeTest.cmake
index 83e63f9..a7519c3 100644
--- a/Tests/RunCMake/GeneratorPlatform/RunCMakeTest.cmake
+++ b/Tests/RunCMake/GeneratorPlatform/RunCMakeTest.cmake
@@ -3,7 +3,7 @@ include(RunCMake)
set(RunCMake_GENERATOR_PLATFORM "")
run_cmake(NoPlatform)
-if("${RunCMake_GENERATOR}" MATCHES "^Visual Studio ([89]|1[012456])( 20[0-9][0-9])?$")
+if("${RunCMake_GENERATOR}" MATCHES "^Visual Studio ([89]|1[0124567])( 20[0-9][0-9])?$")
set(RunCMake_GENERATOR_PLATFORM "x64")
run_cmake(x64Platform)
else()
@@ -17,7 +17,7 @@ set(RunCMake_TEST_OPTIONS -A "Test Platform" -A "Extra Platform")
run_cmake(TwoPlatforms)
unset(RunCMake_TEST_OPTIONS)
-if("${RunCMake_GENERATOR}" MATCHES "^Visual Studio ([89]|1[012456])( 20[0-9][0-9])?$")
+if("${RunCMake_GENERATOR}" MATCHES "^Visual Studio ([89]|1[0124567])( 20[0-9][0-9])?$")
set(RunCMake_TEST_OPTIONS -DCMAKE_TOOLCHAIN_FILE=${RunCMake_SOURCE_DIR}/TestPlatform-toolchain.cmake)
run_cmake(TestPlatformToolchain)
unset(RunCMake_TEST_OPTIONS)
diff --git a/Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake b/Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake
index faed8f7..a742391 100644
--- a/Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake
+++ b/Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake
@@ -1,6 +1,6 @@
include(RunCMake)
-if("${RunCMake_GENERATOR}" MATCHES "Visual Studio 1[012456]")
+if("${RunCMake_GENERATOR}" MATCHES "Visual Studio 1[0124567]")
run_cmake(VsNormal)
include("${RunCMake_BINARY_DIR}/VsNormal-build/defaults.cmake" OPTIONAL)
message(STATUS "VsNormal: platform='${VsNormal_Platform}' toolset='${VsNormal_Toolset}'")
@@ -9,7 +9,7 @@ endif()
set(RunCMake_GENERATOR_TOOLSET "")
run_cmake(NoToolset)
-if("${RunCMake_GENERATOR}" MATCHES "Visual Studio 1[012456]")
+if("${RunCMake_GENERATOR}" MATCHES "Visual Studio 1[0124567]")
set(RunCMake_GENERATOR_TOOLSET "Test Toolset")
run_cmake(TestToolset)
set(RunCMake_GENERATOR_TOOLSET "Test Toolset,cuda=0.0")
@@ -43,7 +43,7 @@ if("${RunCMake_GENERATOR}" MATCHES "Visual Studio 1[012456]")
set(RunCMake_GENERATOR_TOOLSET "${VsNormal_Toolset},customFlagTableDir=does_not_exist")
run_cmake(BadToolsetCustomFlagTableDir)
endif()
- if("${RunCMake_GENERATOR}" MATCHES "Visual Studio 1[2456]")
+ if("${RunCMake_GENERATOR}" MATCHES "Visual Studio 1[24567]")
set(RunCMake_GENERATOR_TOOLSET "Test Toolset,host=x64")
run_cmake(TestToolsetHostArchBoth)
set(RunCMake_GENERATOR_TOOLSET ",host=x64")
@@ -58,7 +58,7 @@ if("${RunCMake_GENERATOR}" MATCHES "Visual Studio 1[012456]")
run_cmake(BadToolsetHostArch)
set(RunCMake_GENERATOR_TOOLSET "Test Toolset,host=x64,host=x86")
run_cmake(BadToolsetHostArchTwice)
- if("${RunCMake_GENERATOR}" MATCHES "Visual Studio 1[56]")
+ if("${RunCMake_GENERATOR}" MATCHES "Visual Studio 1[567]")
set(RunCMake_GENERATOR_TOOLSET "VCTargetsPath=Test Path")
run_cmake(TestToolsetVCTargetsPathOnly)
set(RunCMake_GENERATOR_TOOLSET "Test Toolset,version=Test Toolset Version")
@@ -109,7 +109,7 @@ set(RunCMake_TEST_OPTIONS -T "Test Toolset" -T "Extra Toolset")
run_cmake(TwoToolsets)
unset(RunCMake_TEST_OPTIONS)
-if("${RunCMake_GENERATOR}" MATCHES "Visual Studio 1[012456]|Xcode")
+if("${RunCMake_GENERATOR}" MATCHES "Visual Studio 1[0124567]|Xcode")
set(RunCMake_TEST_OPTIONS -DCMAKE_TOOLCHAIN_FILE=${RunCMake_SOURCE_DIR}/TestToolset-toolchain.cmake)
run_cmake(TestToolsetToolchain)
unset(RunCMake_TEST_OPTIONS)
diff --git a/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchNone.cmake b/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchNone.cmake
index 085bb6b..854f3dc 100644
--- a/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchNone.cmake
+++ b/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchNone.cmake
@@ -1,7 +1,7 @@
message(STATUS "CMAKE_VS_PLATFORM_TOOLSET='${CMAKE_VS_PLATFORM_TOOLSET}'")
message(STATUS "CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE='${CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE}'")
-if(CMAKE_GENERATOR MATCHES "Visual Studio 1[6]")
+if(CMAKE_GENERATOR MATCHES "Visual Studio 1[67]")
cmake_host_system_information(RESULT is_64_bit QUERY IS_64BIT)
if(is_64_bit)
if(NOT "${CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE}" STREQUAL "x64")
diff --git a/Tests/VSExternalInclude/CMakeLists.txt b/Tests/VSExternalInclude/CMakeLists.txt
index e38df8e..a3fd8d8 100644
--- a/Tests/VSExternalInclude/CMakeLists.txt
+++ b/Tests/VSExternalInclude/CMakeLists.txt
@@ -1,7 +1,7 @@
cmake_minimum_required (VERSION 2.8.12)
project(VSExternalInclude)
-if(${CMAKE_GENERATOR} MATCHES "Visual Studio 1[012456]")
+if(${CMAKE_GENERATOR} MATCHES "Visual Studio 1[0124567]")
set(PROJECT_EXT vcxproj)
else()
set(PROJECT_EXT vcproj)
@@ -55,7 +55,7 @@ add_dependencies(VSExternalInclude lib2)
# and the sln file can no longer be the only source
# of that depend. So, for VS 10 make the executable
# depend on lib1 and lib2
-if(${CMAKE_GENERATOR} MATCHES "Visual Studio 1[012456]")
+if(${CMAKE_GENERATOR} MATCHES "Visual Studio 1[0124567]")
add_dependencies(VSExternalInclude lib1)
endif()