Building wxFormBuilder From Source on Mac OSX With XCode

Porting wxFormBuilder to Mac OS X
Guilherme Flach
05/09/2007 (05/Set/2007)

1) Create a new Empty Project in XCode.

2) Create new targets:
	Carbon Dynamic Library
	- liblayout
	- libadditional
	- libcontainers
	- libcommon
	Carbon Application
	- wxFormBuilder
	Agregate
	- Build All

3) Right click on wxFormBuilder group and add (menu Add -> new Group) a new group called Source.

4) Right click on Source group and add folder src, sdk and plugins (menu Add -> Existing Files...). Go to sdk/tinyxml group and delete the reference to the xmltest.cpp file.

5) Drag and drop things...
	- Drag source files to the respective target (Compile Sources). Note that a same source file can be dragged to more than one target (e.g. tinyxml).
	- Drag all targets (except Buill All) to Build All target.
	- Drag all targets (except Build All and wxFormBuilder) to the wxFormBuilder target.

6) In menu Project -> Edit Project Setings, at page Styles change the project settings below:

Other Linker Flags = 'wx-config --libs --static=no'
Other C++ Flags = -DSCI_NAMESPACE -DTIXML_USE_TICPP -D__WX__ 'wx-config --cppflags --static=no'
Header Search Paths = ../src ../sdk/plugin_interface ../sdk/tinyxml ../src/controls/include
ZeroLink = unchecked

7) Select all targets, right click and clean the Prefix Header setting at Style page.

8) Select liblayout, libadditional, libcontainers and libcommon targets, right click on them and Get Info. Change the setting Library Style at Build page to Bundle.

9) Right click on wxFormBuilder target, Add -> New Build Phase -> Copy Files Phase. Set Destination field as PlugIns. Close the window. Now drag liblayout, libadditional, libcontainers and libcommon to the just created Copy Files build phase.

10) Right click on wxFormBuilder project group and add the logo.icns. Do not attach it to any target. Now create a new Build Phase, set the Destination = Resources. Then drag the file logo.icns to the just created build phase.

11) Create a new Shell Script Build Phase to the target wxFormBuilder. Fulfill the field Script with

DIR=$BUILT_PRODUCTS_DIR/$PRODUCT_NAME.app/Contents/SharedSupport/
if [ -d $DIR ]; then rm -r $DIR; else mkdir $DIR; fi
cp -r ../output $DIR

12) Double-Click on the wxFormBuilder target. Go to the Properties page. Change the fields as follow

Creator = WXFB
Icon File = logo.icns

Add a new document type where by clicking at plus and set the column values as follow

Name = wxFormBuilder Project
Extensions = fbp
Icon File = logo.icns

13) At the wxFormBuilder group, rename the file wxFormBuilder-Info.plist to Info.plist.

14) Select as active target the Build All. The build.

15) Run the wxFormBuilder.