配置Cmake命令行

时间:2015-07-28 03:25:20

标签: cmake

我是使用Cmake命令行的新手。使用GUI我可以指定源目录和生成目录。它运作得很好。

当我运行命令行变量时,我没有在构建目录中获得任何输出。

std::tr1::shared_ptr

我还得到其他错误,因为它尝试使用Win32但我指定了Win64。

1 个答案:

答案 0 :(得分:2)

省略--build选项。当你执行cmake configure步骤(相当于cmake gui发生的步骤)时,你不使用--build。生成解决方案和项目后,可以使用cmake --build . --config Debug构建。 (您还可以使用--target MyTarget指定要构建的目标。)

cd c:\MySource\Build
cmake -G "Visual Studio 12 2013 Win64" C:\MySource
cmake --build . --config Debug

对于configure步骤(使用-G选项),您可以使用相对目录..而不是绝对路径 - 两种方式都可以。