如何从现有的git cmake项目创建Xcode项目?

时间:2017-01-24 13:46:10

标签: c++ xcode git macos cmake

我是OSx的新手,有人可以帮助从现有代码创建Xcode项目吗?我想尝试一些Xcode的功能,比如'profile'。

我目前使用Clion作为我的cmake项目,它也在git repo中。我只是想从Xcode导入它,但我想这并不容易。这里有一些关于项目和IDE的信息:

  • 它只是一个用C ++和cmake项目编写的控制台应用程序
  • 它也在git repo上
  • Xcode版本8.0(8A218a)
  • OS El Capitan 10.11.6

如果您需要更多信息,我可以提供更多信息。谢谢你的帮助。

2 个答案:

答案 0 :(得分:22)

Cmake对XCode有一个generator。尝试:

cmake -G Xcode <dir of CMakeLists.txt>

答案 1 :(得分:1)

我的所作所为:

“文件” - &gt; “中新建” - &gt; “中项目...”

选择命令行工具:

enter image description here

如果您愿意,请填写一些内容:

enter image description here

运行虚拟项目:

enter image description here

单击项目文件并将“添加文件”添加到项目中:

enter image description here

浏览你的一堆来源。展开选项。我倾向于使用“添加文件夹”作为“创建组”:

enter image description here

通过并删除你不想要的文件:

enter image description here

构建。可能你需要继续删除文件或添加它们直到你的项目工作。