2.5.2. GUI: Xcode

Open CMake GUI:

../../_images/01-open.png

Click Browse Source... and find directory with CMakeLists.txt and foo.cpp:

../../_images/02-click-browse-source1.png

Now we need to choose directory where to put all temporary files. Let’s create separate directory so we can keep our original directory clean. Click Browse Build..:

../../_images/03-browse-build.png

Find directory with CMakeLists.txt and click New Folder to create _builds directory:

../../_images/04-new-folder.png

Enter _builds and click Create:

../../_images/05-create-new-folder.png

Check the resulted layout:

../../_images/06-check-layout.png

Click on Configure to process CMakeLists.txt:

../../_images/07-configure.png

CMake will ask for the generator you want to use, pick Xcode:

../../_images/08-generator.png

After you click Done CMake will run internal tests on build tool to check that everything works correctly. You can see Configuring done message when finished:

../../_images/09-configure-done.png

For now there was no native build tool files generated, on this step user is able to do additional tuning of the project. We don’t want such tuning now so will run Generate:

../../_images/10-generate-done.png

Now if you take a look at _builds folder you can find generated Xcode project file:

../../_images/11-project-created.png

Open foo.xcodeproj and run executable.