How to create Xcode project from already existing

2020-06-09 04:01发布

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'.

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:

  • 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

If you need more info, I can give more. Thanks for help.

2条回答
欢心
2楼-- · 2020-06-09 04:17

What I do:

"File"->"New"->"Project..."

Select command line tool:

enter image description here

Fill in some stuff if you'd like:

enter image description here

Run the dummy project:

enter image description here

Click on the project file and "Add files to" your project:

enter image description here

Browse to your pile of source. Expand the options. I tend use "added folders" as "Create Groups":

enter image description here

Go through and prune out the files you don't want:

enter image description here

Build. Likely you'll need to keep removing files or adding them till your project works.

查看更多
我只想做你的唯一
3楼-- · 2020-06-09 04:36

Cmake has a generator for XCode. Try:

cmake -G Xcode <dir of CMakeLists.txt>
查看更多
登录 后发表回答