@@ -177,6 +177,7 @@ to their associated toolset or Visual Studio major release:
177
177
178
178
Example mappings:
179
179
180
+ - ``Vcvars_TOOLSET_145_MSVC_VERSIONS`` — MSVC versions associated with toolset ``v145`` (Visual Studio 2026)
180
181
- ``Vcvars_TOOLSET_143_MSVC_VERSIONS`` — MSVC versions associated with toolset ``v143`` (Visual Studio 2022)
181
182
- ``Vcvars_TOOLSET_142_MSVC_VERSIONS`` — MSVC versions associated with toolset ``v142`` (Visual Studio 2019)
182
183
- ``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:
196
197
197
198
Example aliases:
198
199
200
+ - ``Vcvars_VS18_MSVC_VERSIONS`` — aliases ``Vcvars_TOOLSET_145_MSVC_VERSIONS`` (Visual Studio 2026)
199
201
- ``Vcvars_VS17_MSVC_VERSIONS`` — aliases ``Vcvars_TOOLSET_143_MSVC_VERSIONS`` (Visual Studio 2022)
200
202
- ``Vcvars_VS16_MSVC_VERSIONS`` — aliases ``Vcvars_TOOLSET_142_MSVC_VERSIONS`` (Visual Studio 2019)
201
203
- ``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)
222
224
223
225
# See https://github.com/Kitware/CMake/blob/v4.0.3/Modules/Platform/Windows-MSVC.cmake#L72-L101
224
226
227
+ set (Vcvars_TOOLSET_145_MSVC_VERSIONS # VS 2026
228
+ 1959 1958 1957 1956 1955 1954 1953 1952 1951 1950
229
+ )
225
230
set (Vcvars_TOOLSET_143_MSVC_VERSIONS # VS 2022
226
231
1949 1948 1947 1946 1945 1944 1943 1942 1941 1940
227
232
1939 1938 1937 1936 1935 1934 1933 1932 1931 1930
@@ -244,6 +249,7 @@ set(Vcvars_TOOLSET_60_MSVC_VERSIONS 1200) # VS 6.0
244
249
245
250
# See https://en.wikipedia.org/wiki/Microsoft_Visual_C%2B%2B#Internal_version_numbering
246
251
# and https://gitlab.kitware.com/cmake/cmake/-/merge_requests/9271
252
+ set (Vcvars_VS18_MSVC_VERSIONS ${Vcvars_TOOLSET_145_MSVC_VERSIONS} ) # VS 2026
247
253
set (Vcvars_VS17_MSVC_VERSIONS ${Vcvars_TOOLSET_143_MSVC_VERSIONS} ) # VS 2022
248
254
set (Vcvars_VS16_MSVC_VERSIONS ${Vcvars_TOOLSET_142_MSVC_VERSIONS} ) # VS 2019
249
255
set (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
261
267
set (_Vcvars_MSVC_ARCH_REGEX "^(32|64)$" )
262
268
set (_Vcvars_MSVC_VERSION_REGEX "^[0-9][0-9][0-9][0-9]$" )
263
269
set (_Vcvars_SUPPORTED_MSVC_VERSIONS
270
+ ${Vcvars_TOOLSET_145_MSVC_VERSIONS} # VS 2026
264
271
${Vcvars_TOOLSET_143_MSVC_VERSIONS} # VS 2022
265
272
${Vcvars_TOOLSET_142_MSVC_VERSIONS} # VS 2019
266
273
${Vcvars_TOOLSET_141_MSVC_VERSIONS} # VS 2017
@@ -296,7 +303,9 @@ function(Vcvars_ConvertMsvcVersionToVsVersion msvc_version output_var)
296
303
message (FATAL_ERROR "msvc_version is expected to match `${_Vcvars_MSVC_VERSION_REGEX} `" )
297
304
endif ()
298
305
# 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
300
309
set (vs_version "17" )
301
310
elseif (msvc_version IN_LIST Vcvars_VS16_MSVC_VERSIONS) # VS 2019
302
311
set (vs_version "16" )
@@ -330,7 +339,9 @@ function(Vcvars_ConvertMsvcVersionToVcToolsetVersion msvc_version output_var)
330
339
if (NOT msvc_version MATCHES ${_Vcvars_MSVC_VERSION_REGEX} )
331
340
message (FATAL_ERROR "msvc_version is expected to match `${_Vcvars_MSVC_VERSION_REGEX} `" )
332
341
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
334
345
set (vc_toolset_version "14.3" )
335
346
elseif (msvc_version IN_LIST Vcvars_TOOLSET_142_MSVC_VERSIONS) # VS 2019
336
347
set (vc_toolset_version "14.2" )
0 commit comments