Making Xcode Install Your Object
Xcode includes a provision for copying your built object to a location you specify. This is nice because you can have the object copied right into your Max search path. If you set up the
MaxMSP Runtime application as your executable (see below), you can launch the debugger on the latest version of your object without ever leaving Xcode. However, the options for doing this are a bit complex and confusing. Fortunately, we've figured out what you need to know, and we'll try to explain it here.
The very short answer is that if you configure a testing version of Max in a folder called sysbuild, you can just check the Build Settings window option called Deployment Location in the example SDK projects, and they will be copied right into the Cycling '74 externals folder. However, this answer is too short if you want to understand how this actually works.
While editing the target of your project, choose Deployment from the Collection menu at the top of the window. Don't choose Deployment from the Configuration menu above the Collection menu!
That "Deployment" refers to the name of a build configuration, not a collection of settings having to do with where your object is placed once it is built.
The top few settings in the Deployment collection are useful for the installation of your external object.
The first one, Deployment Location, is basically a switch that turns the whole install process on or off. If Deployment Location isn't checked, the rest of the settings have no effect. We've turned off Deployment Location in the SDK example projects, so external objects are placed in the build directory inside each object's project directory.
The second setting, Deployment Postprocessing, changes the ownership and permissions of your object after you build it. This shouldn't matter for Max externals, because they are never opened for writing.
The third setting, Installation Build Products Directory, requires some background explanation. Xcode has a command-line version called xcodebuild, that you can use for building projects from a shell. You might create a script to build all of your externs, for example. You might want to be able to change the install location as an argument to the script. In particular, you might want one location for testing (for example, the Cycling '74 folder) and another for building a collection of objects that you would like to distribute. Essentially, the Installation Build Products Directory plus the Installation Directory determine where your object will be installed.
In the SDK example projects, the Installation Build Products Directory is set to the project directory $(PROJECT_DIR), so that the install will be relative to the location of the project. If you want to build to a directory that will be specified as an absolute location, you could use / as the Installation Build Products Directory.
The fourth setting, Installation Directory, sets the location, relative to the Installation Build Products Directory, for the installation of your object. In the example SDK, this is set to ../../../sysbuild/$(CONFIGURATION)/Cycling '74/externals. This means: take the project directory, go three levels up, go into the sysbuild directory, go into either the Development or Deployment directory inside of it, depending the current build configuration, then put the external in the externals directory inside the Cycling '74 directory.
Next:
Debugging Your Object in Xcode
Return to the Max/MSP Universal Binary SDK
Table of Contents
--
DavidZicarelli - 05 Apr 2006
to top