Skip to content

New projects in Xcode 4

Shawn Roske edited this page Aug 6, 2013 · 2 revisions

As of writing these instructions, the currently stable version of Xcode is 4.6.3

Creating a new "normal" project (i.e. not using a hosted Cocoa view)

  1. Create a new "Cocoa Application" project.
  2. Ensure that "Automatic Reference Counting" is disabled!
  3. Delete all the unused source files (AppDelegate.h/.m, MainMenu.xib, main.m, PCH file, etc.)
  4. Add your application source file to the project (i.e. Simple_BasicApplication.cpp)
  5. Add the "data" directory to the project, ensure that "Create groups for any added folders" is selected.
  6. Remove the CingConfig.xml from the data directory (if it is present) as it is not used in OS X projects.
  7. Add the "cing_bin" directory to the project, ensure that "Create folder references for any added folders" is selected.
  8. Add the Cing project from cing/build/mac/xcode/Cing.xcodeproj by selecting "Add files to projectname".
  9. Add the output of the Cing project (Cing.framework) as a target dependency for your project under "Build Phases" -> "Target Dependencies"
  10. Add Cing.framework as a linked library under "Build Phases" -> "Link Binary with Libraries"
  11. Add a "Copy Files" build phase, change the destination to be "Frameworks" and add Cing.framework to this build phase.
  12. Add the Ogre dependencies to your custom "Copy Files" build phase, they can be found under cing/libraries/mac/xcode/OgreSDK/lib/macosx/Release. Be sure to add all the frameworks in that directory. Also add Cg.framework from cing/libraries/mac/xcode/OgreDepedencies/Frameworks.
  13. Add the Cing framework header paths to the project "Header Search Paths" within the "Build Settings" tab ($(BUILT_PRODUCTS_DIR)/Cing.framework/Headers, $(BUILT_PRODUCTS_DIR)/Cing.framework/Headers/OIS, $(BUILT_PRODUCTS_DIR)/Cing.framework/Resources)
  14. Change the "Architectures" option under the "Build Settings" tab to be "32-bit Intel" only
  15. Change the "C++ Language Dialect" under the "Build Settings" tab to be "GNU++98"
  16. Change the "C++ Standard Library" under the "Build Settings" tab to be "libstdc++"
  17. remove the "Prefix Header" entry entirely under the "Build Settings"

If you have everything set up it should not build correctly (first building Cing then your project). You will need to set up the directory structure manually for data and cing_bin, but that should be changing shortly. Also if you get runing dylib errors please see the wiki page on build notes for the Mac port.

Creating a project that uses a hosted Cocoa View

TODO!

Generally follow the same steps as above, just do not remove the generated project files (such as AppDelegate.h/m, etc.)