Sunday, April 3, 2022

[SOLVED] How does CMake specify "Platform Toolset" for a Visual Studio 2015 project?

Issue

There is a VS2015 project which is generated by CMake and I want to change its "Platform Toolset".

src="https://i.stack.imgur.com/MHhqR.jpg" alt=""Platform Toolset" Location">

I have tried these solutions but it doesn't work:

  1. set (CMAKE_VS_PLATFORM_TOOLSET "v120")

  2. cmake -T "v120"

Can anyone help? Thanks.


Solution

First of all: remove the CMakeCache.txt if you have already generated your project. Next run cmake:

cmake -G "Visual Studio 14" -T v120

Whenever you need to change your generator(and the toolset is a part of it) you should remove the CMakeCache.txt file.



Answered By - ixSci
Answer Checked By - Robin (WPSolving Admin)