自定义Architecture
vs2008-vs2017
cmake.exe ../ -G"Visual Studio 12 2013 Win32"
vs2019 and latter
cmake.exe ../ -G" Visual Studio 17 2022" -A" Win32"
参考信息:
Visual Studio 17 2022 = Generates Visual Studio 2022 project files.
Use -A option to specify architecture.
Visual Studio 16 2019 = Generates Visual Studio 2019 project files.
Use -A option to specify architecture.
Visual Studio 15 2017 [arch] = Generates Visual Studio 2017 project files.
Optional [arch] can be "Win64" or "ARM".
Visual Studio 14 2015 [arch] = Generates Visual Studio 2015 project files.
Optional [arch] can be "Win64" or "ARM".
Visual Studio 12 2013 [arch] = Generates Visual Studio 2013 project files.
Optional [arch] can be "Win64" or "ARM".
Visual Studio 11 2012 [arch] = Generates Visual Studio 2012 project files.
Optional [arch] can be "Win64" or "ARM".
Visual Studio 10 2010 [arch] = Generates Visual Studio 2010 project files.
Optional [arch] can be "Win64" or "IA64".
Visual Studio 9 2008 [arch] = Generates Visual Studio 2008 project files.
Optional [arch] can be "Win64" or "IA64".
定义Compiler ToolSet
使用-T选项,其值从下图中的一个括号内取
例如:
使用VS2022 + Win32 + v120(vs2013的编译器)
cmake.exe ../ -G"Visual Studio 17 2022" -T"v120" -A"Win32"
使用VS2015 + Win32 + v120(vs2013的编译器)
cmake.exe ../ -G"Visual Studio 14 2015 Win32" -T"v120"