I installed both VS2015 and VS2017. For a cmake project, I want to use cmake to generate a vs2015 project (platform toolset v140).
I Opened the Developer Command Prompt for VS2015
then I ran cmake
there.
But from the output and also the result sln file, I see it's still using vs2017 (v141) platform toolset.
-- Building for: Visual Studio 15 2017 -- The C compiler identification is MSVC 19.16.27027.1 -- The CXX compiler identification is MSVC 19.16.27027.1 -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe -- works
Please see the screenshot here: cmake vs2015
So, how to I force cmake to use vs2015?