如何从现有的 git cmake 项目创建 Xcode 项目?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/41829852/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to create Xcode project from already existing git cmake project?
提问by Richard
I am new to OSx, can someone help to create Xcode project from existing code? I want to try some features of Xcode like 'profile'.
我是 OSx 的新手,有人可以帮助从现有代码创建 Xcode 项目吗?我想尝试一些 Xcode 的功能,比如“配置文件”。
I currently use Clion for my cmake project, it is also in git repo. I simply want to import it from Xcode but it's not that easy I guess. Here some info about project and IDE:
我目前在我的 cmake 项目中使用 Clion,它也在 git repo 中。我只是想从 Xcode 导入它,但我想这并不容易。这里有一些关于项目和 IDE 的信息:
- It is just a console app written in C++ and cmake project
- It is also on git repo
- Xcode Version 8.0 (8A218a)
- OS El Capitan 10.11.6
- 它只是一个用 C++ 和 cmake 项目编写的控制台应用程序
- 它也在 git repo 上
- Xcode 8.0 版 (8A218a)
- 操作系统 El Capitan 10.11.6
If you need more info, I can give more. Thanks for help.
如果您需要更多信息,我可以提供更多信息。感谢帮助。
回答by Waldson Patricio
回答by RichardPowell
What I do:
我所做的:
"File"->"New"->"Project..."
“文件”->“新建”->“项目...”
Select command line tool:
选择命令行工具:
Fill in some stuff if you'd like:
如果您愿意,请填写一些内容:
Run the dummy project:
运行虚拟项目:
Click on the project file and "Add files to" your project:
单击项目文件并“将文件添加到”您的项目:
Browse to your pile of source. Expand the options. I tend use "added folders" as "Create Groups":
浏览到您的源代码堆。展开选项。我倾向于使用“添加文件夹”作为“创建组”:
Go through and prune out the files you don't want:
遍历并删除您不想要的文件:
Build. Likely you'll need to keep removing files or adding them till your project works.
建造。您可能需要不断删除或添加文件,直到您的项目正常运行。