Windows
vs2015 x64编译器为例,cmake命令如下:
cmake -G "Visual Studio 14 Win64" path\to\source\dir
去掉Win64,就是32bit:
cmake -G "Visual Studio 14" path\to\source\dir
另外一种等价方式,用命令行参数-A来指定架构(x64或者ARM):
cmake -A x64 path\to\source\dir
更多参考:
https://cmake.org/cmake/help/v3.1/manual/cmake-generators.7.html#ide-build-tool-generators