Making an Xcode Project

This tutorial is assuming you're starting with a working .c file, probably moving an older project over to Xcode. It would be easiest to start with a CNMAT object that exists at the same level in the Hierarchy of your Working Copy of the CNMAT Repository as the new one, and copy it. But, I've also started with the example objects in the UB SDK. I'll cover that, since it requires a few more steps.

â–ª Select the preexisting project, and copy it's whole folder to where you want the new folder. In the SDK, maximum is the Max Object and plus~ is the MSP object.
â–ª Rename your new folder. For this tutorial I'll pretend you're copying maximum and making an object called paprika. So, substitute your object name wherever you see paprika. Rename your maximum copy folder to paprika. Inside your folder should be this:

â–ª You won't need the .c, .def, .mcp, or .vcproj files for this tutorial; feel free to ignore them or delete them. You might need the .def and .vcproj files when you compile for Windows, and the .c file might be useful starting point if you are starting your code from scratch.
â–ª rename maximum.xcodeproj to paprika.xcodeproj
â–ª drop your C Code into the folder, which should now look like this:


â–ª Now would be a good time to drag in any other custom include that you know you might need. Check with Matt about the SDIF includes, OSC includes etc. These live in a separate place in the Repository and are dealt with below. Do not drag these to your project folder.
â–ª Double-click on Info.plist to edit it with Property List Editor. Click the little triangle next to "Root" to see all the info.
â–ª change the word maximum, on the third line to paprika; change com.cycling74.maximum, on the fifth line, to edu.berkeley.cnmat.paprika You should now see something like this:


â–ª close this file, click save, and quit Property List Editor.
â–ª Ok, on to the Xcode Project. Double-click paprika.xcodeproj to open it.
â–ª If you deleted maximum.c earlier, you'll see that it's red now. Right-click, and select "delete" to remove it from your project.
â–ª Drag paprika.c to the Source folder in the left pane to add it to your project. Accept the default settings and click "Add". You should be here now:


â–ª Go to the Project menu and select Edit Active Target 'maximum'
â–ª In the General pane, change the name to paprika:


â–ª Go to the Build pane. Make sure Configuration is All Configurations and change Collection to Packaging.
â–ª Change the Product Name to paprika, like so:


â–ª The next few steps deal with Search Paths. These may be different for your object, so make sure you understand the structure of the Repository when you're doing them.
â–ª Select Search Paths from the Collection menu.
â–ª The Header Search Paths currently reads ../../c74/max-includes. For Max externals, you can edit that to be ../../../c74/max-includes like:


â–ª Select Language from the Collection menu. (Beneath GNU C/C++ Compiler 4.0)
â–ª Change the Prefix Header from ../../c74support/max-includes/macho-prefix.h to the proper path, ../../../c74support/max-includes/macho-prefix.h (Shown here in mid-edit)


â–ª MSP objects will also want ../../c74/msp-includes changed to ../../../c74/msp-includes
â–ª Close the Target info window.
â–ª The last part involves Frameworks. Since CNMAT doesn't believe in Frameworks, this might change. Click the triangle next to External Frameworks and... in the left pane


â–ª Right click on MaxAPI.framework and select delete to remove it. You might also have MaxAudioAPI.framework, if this is an MSP external. Remove that too.
â–ª Find those frameworks in your working copy of the the CNMAT Repository: /trunk/max/SDK/UB-SDK/
â–ª Drag them into your project where you deleted the other frameworks. Click Add to accept the default settings. Your project should look like the last picture again.
â–ª That's it, you should be ready to compile. email mzed@cnmat.berkeley.edu with questions. Objects with additional includes, like the SDIF objects, will want more editing in the Search Path pane. More on that below.

What to check in
â–ª When you go to check in your work, there is one more step. paprika.xcodeproj might look like a file, but it is actually a directory. And, it contains things we don't want to check in.
â–ª Right click on paprika.xcodeproject and select Show Package Contents. You'll see a bunch of files, like:
â–ª
â–ª Delete everything except for project.pbxproj, that is the only thing we want in the repositiory.
â–ª Use SVN to add and commit the paprika.xcodeproj before you open Xcode again. Opening Xcode will rebuild the files you deleted.
â–ª Also check in the Info.plist file, and paprika.c. Usually, nothing else is needed.

Additional Paths
â–ª Objects like OSC-route need to find some additional files I did two additional things to make it work
â–ª Add a path to the OSC-Kit in User Header Search Path. I suppose I could have added to the Header Search Paths, but it works this way.


â–ª I added OSC-pattern-match.c to the project by dragging it from it's place in my Working Copy to the Source folder in the left pane of my Xcode Project. Ask Matt what .c files you might need. Don't copy the file into your project folder.