@@ -177,6 +177,7 @@ to their associated toolset or Visual Studio major release:
177177
178178 Example mappings:
179179
180+ - ``Vcvars_TOOLSET_145_MSVC_VERSIONS`` — MSVC versions associated with toolset ``v145`` (Visual Studio 2026)
180181 - ``Vcvars_TOOLSET_143_MSVC_VERSIONS`` — MSVC versions associated with toolset ``v143`` (Visual Studio 2022)
181182 - ``Vcvars_TOOLSET_142_MSVC_VERSIONS`` — MSVC versions associated with toolset ``v142`` (Visual Studio 2019)
182183 - ``Vcvars_TOOLSET_141_MSVC_VERSIONS`` — MSVC versions associated with toolset ``v141`` (Visual Studio 2017)
@@ -196,6 +197,7 @@ to their associated toolset or Visual Studio major release:
196197
197198 Example aliases:
198199
200+ - ``Vcvars_VS18_MSVC_VERSIONS`` — aliases ``Vcvars_TOOLSET_145_MSVC_VERSIONS`` (Visual Studio 2026)
199201 - ``Vcvars_VS17_MSVC_VERSIONS`` — aliases ``Vcvars_TOOLSET_143_MSVC_VERSIONS`` (Visual Studio 2022)
200202 - ``Vcvars_VS16_MSVC_VERSIONS`` — aliases ``Vcvars_TOOLSET_142_MSVC_VERSIONS`` (Visual Studio 2019)
201203 - ``Vcvars_VS15_MSVC_VERSIONS`` — aliases ``Vcvars_TOOLSET_141_MSVC_VERSIONS`` (Visual Studio 2017)
@@ -222,6 +224,9 @@ cmake_minimum_required(VERSION 3.20.6...3.22.6 FATAL_ERROR)
222224
223225# See https://github.com/Kitware/CMake/blob/v4.0.3/Modules/Platform/Windows-MSVC.cmake#L72-L101
224226
227+ set (Vcvars_TOOLSET_145_MSVC_VERSIONS # VS 2026
228+ 1959 1958 1957 1956 1955 1954 1953 1952 1951 1950
229+ )
225230set (Vcvars_TOOLSET_143_MSVC_VERSIONS # VS 2022
226231 1949 1948 1947 1946 1945 1944 1943 1942 1941 1940
227232 1939 1938 1937 1936 1935 1934 1933 1932 1931 1930
@@ -244,6 +249,7 @@ set(Vcvars_TOOLSET_60_MSVC_VERSIONS 1200) # VS 6.0
244249
245250# See https://en.wikipedia.org/wiki/Microsoft_Visual_C%2B%2B#Internal_version_numbering
246251# and https://gitlab.kitware.com/cmake/cmake/-/merge_requests/9271
252+ set (Vcvars_VS18_MSVC_VERSIONS ${Vcvars_TOOLSET_145_MSVC_VERSIONS} ) # VS 2026
247253set (Vcvars_VS17_MSVC_VERSIONS ${Vcvars_TOOLSET_143_MSVC_VERSIONS} ) # VS 2022
248254set (Vcvars_VS16_MSVC_VERSIONS ${Vcvars_TOOLSET_142_MSVC_VERSIONS} ) # VS 2019
249255set (Vcvars_VS15_MSVC_VERSIONS ${Vcvars_TOOLSET_141_MSVC_VERSIONS} ) # VS 2017
@@ -261,6 +267,7 @@ set(Vcvars_VS6_MSVC_VERSIONS ${Vcvars_TOOLSET_60_MSVC_VERSIONS}) # VS 6.0
261267set (_Vcvars_MSVC_ARCH_REGEX "^(32|64)$" )
262268set (_Vcvars_MSVC_VERSION_REGEX "^[0-9][0-9][0-9][0-9]$" )
263269set (_Vcvars_SUPPORTED_MSVC_VERSIONS
270+ ${Vcvars_TOOLSET_145_MSVC_VERSIONS} # VS 2026
264271 ${Vcvars_TOOLSET_143_MSVC_VERSIONS} # VS 2022
265272 ${Vcvars_TOOLSET_142_MSVC_VERSIONS} # VS 2019
266273 ${Vcvars_TOOLSET_141_MSVC_VERSIONS} # VS 2017
@@ -296,7 +303,9 @@ function(Vcvars_ConvertMsvcVersionToVsVersion msvc_version output_var)
296303 message (FATAL_ERROR "msvc_version is expected to match `${_Vcvars_MSVC_VERSION_REGEX} `" )
297304 endif ()
298305 # See https://en.wikipedia.org/wiki/Microsoft_Visual_C%2B%2B#Internal_version_numbering
299- if (msvc_version IN_LIST Vcvars_VS17_MSVC_VERSIONS) # VS 2022
306+ if (msvc_version IN_LIST Vcvars_VS18_MSVC_VERSIONS) # VS 2026
307+ set (vs_version "18" )
308+ elseif (msvc_version IN_LIST Vcvars_VS17_MSVC_VERSIONS) # VS 2022
300309 set (vs_version "17" )
301310 elseif (msvc_version IN_LIST Vcvars_VS16_MSVC_VERSIONS) # VS 2019
302311 set (vs_version "16" )
@@ -330,7 +339,9 @@ function(Vcvars_ConvertMsvcVersionToVcToolsetVersion msvc_version output_var)
330339 if (NOT msvc_version MATCHES ${_Vcvars_MSVC_VERSION_REGEX} )
331340 message (FATAL_ERROR "msvc_version is expected to match `${_Vcvars_MSVC_VERSION_REGEX} `" )
332341 endif ()
333- if (msvc_version IN_LIST Vcvars_TOOLSET_143_MSVC_VERSIONS) # VS 2022
342+ if (msvc_version IN_LIST Vcvars_TOOLSET_145_MSVC_VERSIONS) # VS 2026
343+ set (vc_toolset_version "14.5" )
344+ elseif (msvc_version IN_LIST Vcvars_TOOLSET_143_MSVC_VERSIONS) # VS 2022
334345 set (vc_toolset_version "14.3" )
335346 elseif (msvc_version IN_LIST Vcvars_TOOLSET_142_MSVC_VERSIONS) # VS 2019
336347 set (vc_toolset_version "14.2" )
0 commit comments