MEXTemplate is a XCode Project Template for creating MEX files. To use it drop the MEXTemplate folder in ~/Library/Application Support/Developer/Shared/Xcode/Project Templates. It should show up in the dialog if you choose File -> New Project... The created project allows you to build and debug MEX files and is setup according to: http://www.mathworks.com/support/solutions/data/1-3U6RYL.html?solution=1-3U6RYL
Installation:
First download the zip. Unzip the file in ~/Library/Application Support/Developer/Shared/Xcode/Project Templates for personal installation or /Library/Application Support/Developer/Shared/Xcode/Project Templates for system wide installation. Should the file already be unzipped make sure you move the folder "MEXTemplate" to the specified folder and not just the contents.
Usage:
- Create a new project in XCode by choosing File -> New Project...
- In the then presented dialog choose "MEXTemplate"
- If you have installed Matlab r2008a in the default location then pressing "Build and Go" should build the supplied hello world example. If you have another matlab version or installed it in a different place, see below "Matlab versions". To see Matlab running you need to open the console (⌘⇧R) and call your functionname (same as your project name).
Matlab versions:
Until I figure out how to find matlab automagically, you need too check/change the path at serveral places. For building you have to change the setting "MATLABROOT" of your target to your matlab path. You can find this path by typing `matlabroot' on your matlab command prompt. For the debugging part you need to check/change the settings for the executable "MATLAB". Replace "/Applications/MATLAB_R2008a" to your matlab root path. Yes that is a few copy-pastes...
Troubleshooting:
First check whether the project settings match those specified on http://www.mathworks.com/support/solutions/data/1-3U6RYL.html?solution=1-3U6RYL. If that doesn't solve the problem mail me with as much information as possible!
License:
Basically none, feel free to do whatever you want with it. I do however appreciate a link to the project (http://www.krijnders.net/personal/computer/MEXTemplate) on your project side and a mail mentioning you use it.
Changelog:
0.1 First releaseLinks/credits
XcodeTemplateFactory The software used in the conversion from a normal project to a xcode project template.
Several blogs/sites about making xcode project templates: