简体   繁体   中英

How to create Xcode project from already existing git cmake project?

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.

Cmake has a generator for XCode. Try:

cmake -G Xcode <dir of CMakeLists.txt>

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM