The Cocotron is an open source project which aims to implement a cross-platform Objective-C API similar to that described by Apple Inc.'s Cocoa documentation. This includes the AppKit, Foundation, Objective-C runtime and support APIs such as CoreGraphics and CoreFoundation.

Cocotron Tools

How to Cross-Compile

Cross-compiling is as easy as using Xcode for an OS X project - you just have to set things up correctly. This primarily consists of creating a target for the desired platform and modifying the build rules and settings. These instructions are for native Xcode targets.

Step One, creating the cross-compilation target

The easiest way to do this is to just duplicate an existing OS X target and name it accordingly, e.g. duplicate the target MyApp and name it MyApp-Windows. If you need platform dependent source the easiest thing is to either exclude or include them in your platform specific targets.

Step Two, add a compiler Rule

Modify the Rules for the new cross-compiled target to use one of the CDT compilers. Get Info on the target, click Rules, click the little + sign in the lower left, on this new rule Process: "C source files" using: "Cocotron ... gcc ..." compiler of your choice.

Step Three, modify the Build settings

What you need to do here is remove all the OS X specific Customized Settings so that the defaults are used and then add the target specific settings for the particular platform. Overall these settings are similar across platforms but they do vary.

Once these steps are complete you should be able to compile your new target for the desired platform.