2.5.4. CLI: XcodeΒΆ

Open terminal and go to the directory with sources:

> cd cgold-example
[cgold-example]> ls
CMakeLists.txt foo.cpp

Generate Xcode project using CMake. Use -H. -B_builds for specifying paths and -GXcode for the generator:

[cgold-example]> cmake -H. -B_builds -GXcode
-- The C compiler identification is AppleClang 7.3.0.7030031
-- The CXX compiler identification is AppleClang 7.3.0.7030031
-- Check for working C compiler: /.../Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
-- Check for working C compiler: /.../Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /.../Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++
-- Check for working CXX compiler: /.../Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/ruslo/cgold-example/_builds

You can start IDE by open _builds/foo.xcodeproj (add -a to set the version of Xcode you need: open -a /Applications/develop/ide/xcode/6.4/Xcode.app _builds/foo.xcodeproj) and run example from IDE or keep using command line.