在 Eclipse 中从 github 导入 cmake 项目

Import cmake project from github in Eclipse

我正在尝试将项目 grive2 导入到 Eclipse 中。我认为最简单的方法是使用 Eclipse 的内置 git 支持。 这是通过 File->Import->Git->Projects From GIT 执行的 然后我选择 Clone URI 并输入 URI。设置目标路径后,我看到了这个对话框:

为此我 select 编辑了 Import using the New Project wizard 选项(我不知道这是否正确!? 然后在新向导中,我 select 使用现有代码的 Makefile 项目。

接下来window我不得不设置项目的路径和编译器:

在这一步之后,项目被输入到右侧项目的eclipse 树中。 现在单击构建(栏中的小锤子)时,我收到输出消息

 18:55:32 **** Incremental Build of configuration Default for project    
 grive2 ****
 make all 
 make: *** No rule to make target 'all'.  Stop.

 18:55:32 Build Finished (took 73ms)

我还需要做什么才能构建和编译它?

自述文件在他们的 git 存储库中包含以下说明:

mkdir build
cd build
cmake ..
make -j4
sudo make install

您需要先 运行 cmake。它会做它需要做的事情,并给你一个 运行 的 make 文件。您不需要 eclipse 来构建和编译!

eclipse 市场有一个插件可以为您生成 makefile 和构建目录:cmake4eclipse