VS: CMake always chooses latest minor toolset version under VS Command Prompt
I'm trying to use an older toolset version (14.27) with VS 16.11 but CMake is always choosing the latest (14.29).
- Install VS 16.11 (the public preview) and also install the 14.27 toolset (from individual components).
- Open a command prompt and run
<vs install dir>/VC/Auxiliary/Build/vcvars64.bat -vcvars_ver=14.27(I wasn't sure if just a plain developer prompt is expected to respect the toolset version so I specified the version manually to be extra sure).
- Create a CMake project and run
cmake <source dir> -G "Visual Studio 16 2019" -T version=14.27.
I tried using CMake 3.19.8, 3.20, and 3.21. Note I'm able to switch between different major toolsets just fine (e.g. -T v141 or -T v141,version=14.16), it just seems to be the minor version.
I was able to repro on a clean VM with just VS installed (using the bundled CMake of 3.20) as well.