Building wxFormBuilder From Source on Mac OSX
Purpose
wxFormBuilder Build Steps
Includes
- wxFormBuilder
- wxFormBuilder SDK
- wxFormBuilder 3rd Party Controls
Notes
- Subversion is a great free cross-platform version control manager. It can be found here:
http://subversion.tigris.org.
wxWidgets
Get wxWidgets from http://www.wxwidgets.org. wxWidgets comes pre-installed with OS X 10.5, therefore if you have this version of the OS you can probably skip this step.
Download the wxMac source archive, and build it as a dynamic library (i.e. do not pass --disable-shared to configure) and Unicode (--enable-unicode). Example:
cd path/to/wxWidgets mkdir dynamic-unicode cd dynamic-unicode ../configure --enable-unicode --with-opengl --with-libjpeg=builtin --with-libpng=builtin --with-regex=builtin --with-libtiff=builtin --with-zlib=builtin --with-expat=builtin make sudo make install
For more information, see wxWiki page http://www.wxwidgets.org/wiki/index.php/Getting_started_on_OS_X and/or read the READMEs that come with wxWidgets. Note: i enabled OpenGL because it is an API of choice on OS X but i don't believe you need it for building wxFormBuilder.
Tip : on mac OS X 10.4, Apple ships wxWidgets 2.5 in prefix /usr. Your install will go to /usr/local.
1) Make sure /usr/local/bin is in your PATH otherwise the new wxWidgets won't be detected at all and you will only get the old one (to set PATH see http://www.troubleshooters.com/linux/prepostpath.htm)
2) If /usr/bin comes before /usr/local/bin in your PATH, you will still get the old one (running wx-config --version will help you find out). You can fix this either by putting /usr/local/bin before in your path (understand that this affects not only wx but all unix executables) or move the old one with something like sudo mv /usr/bin/wx-config /usr/bin/wx-config-2.5
Building and Installing
- Get the wxFormBuilder source (3.0-RC4 or newer is required for mac support)
- If you built premake from source, copy executable /path/to/premake/bin/premake to /path/to/wxFormBuilder/sdk/premake/premake-mac.
The rest is done on the terminal:
cd /path/to/wxFB ./create_build_files.sh make
A double-clickable application will appear in /output if all went correctly! If all you wanted is a working app for yourself you can stop there.
Troubleshooting
If the produced executable doesn't work, I suggest you read documentation about install_name_tool and otool (especially otool -L) in order to fix library support. Also see the post-build steps at : install/macosx/postbuild.sh.
Getting it ready for distribution
If you want to distribute this app, note that the person you send it to will need to have wxWidgets built with the same settings as you for it to work. To include wxWidgets inside the app bundle so that it can be distributed and run from any mac, take a look at install_name_tool or http://macdylibbundler.sf.net.
After installing macdylibbundler, you can simply run './install/macosx/makedist.sh'. When you run that command, if everything went correctly, your app should be distributable (i.e. you can send it to anyone that has a mac and it will run without them needing to install anything.) since dylibbundler is not stable yet, i would recommend checking first (e.g. sudo mv /usr/local/lib /usr/local/lib-disabled and then trying to run the app will tell you, granted you avoid installing stuff in /usr/lib. and don't forget to run the opposite command after of course!)
If you distribute the application, check the Info.plist file to make sure the version in it is the right one (under CFBundleVersion and CFBundleShortVersionString) and if not, edit it.
Then, before packaging it as dmg or zip, run the following command to remove svn files that remain in (don't do that in the wxFB source checkout, but on a copy)
find . -name ".svn" -exec rm -rf '{}' \;