How does CMake specify “Platform Toolset” for a Visual Studio 2015 project?

后端 未结 3 1210
深忆病人
深忆病人 2020-11-30 12:17

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

\""Pla

相关标签:
3条回答
  • 2020-11-30 12:49

    Using CMAKE_GENERATOR_TOOLSET is better than using the -T option.

    It's not required to remove the CMakeCache.txt file when re-generating CMake.

    e.g.

    cmake -G "Visual Studio 16" -A Win32 -DCMAKE_GENERATOR_TOOLSET=v140
    
    0 讨论(0)
  • 2020-11-30 12:56

    For anyone finding this, the solution is to use CMAKE_SYSTEM_VERSION.

    eg.

    cmake -DCMAKE_SYSTEM_VERSION=8.1 .
    
    0 讨论(0)
  • 2020-11-30 13:03

    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.

    0 讨论(0)
提交回复
热议问题