mchelper

mchelper - Make Controller Helper - is an application, written with Qt 4, that uploads firmware to the Make Controller, and then provides a simple interface for sending simple OSC commands to/from the board. We'll go over here how to:

  • Build & Install Qt
  • Build mchelper on OS X
  • Build mchelper on Windows
  • Build mchelper on Linux

Installing Qt

Fortunately, for open source projects Qt is provided freely under the GNU GPL. There can be a few snags along the way trying to get this set up on your system, so we'll outline the steps for getting Qt installed properly on your machine.

Windows

On Windows, you'll almost certainly want to download the Qt installer that also installs MinGW. Check out the Qt Windows Download Page and grab whatever the latest version is, making sure to get the version that looks like /path/to/qt-win-opensource-4.x.x-mingw.exe. This should get you an installer that will get you all set up with just a double click.

OS X

Download the latest source for Qt on OS X here. Once you've uncompressed the source package, there's the potentially sticky issue of building Qt. It's actually not bad at all, but there are a couple configuration flags to be sure to set when you're building it.

We'll venture into Terminal.app to build Qt. There are just a couple of flags of interest:

  • prefix - where to install Qt. I usually just keep this in /Developer/Qt-4.x.x, although the default location is /usr/local/Trolltech/Qt-4.x.x
  • static - specifies whether Qt is built as static or shared libraries. The default is as shared libraries, which makes for quicker rebuilds and is generally recommended. However, to distribute your final app to people that don't have Qt installed, you'll need to build it statically. Kind of a drag.
  • universal - whether to the Qt installation will create Universal Binary code or code for your native platform.
  • sdk - the path to the OS X SDK Qt will use. If you've passed the -universal flag, make sure this SDK is for OS X 10.4 or later.

So, a sample configuration for building Qt might look like this:

# cd into the src directory...I keep mine in /Developer/Qt-src-4.x.x
cd /Developer/Qt-src-4.x.x
# now configure the build process, then build it
./configure -prefix /Developer/Qt-4.x.x -universal -sdk /Developer/SDKs/MacOSX10.4u.sdk
make
make install

This will take quite a while, so make sure you have some other exciting things to do in the meantime. When it's finally finished, you'll want to add the Qt tools to your path. There are plenty of ways to do this, but I just either do it in vi or in another editor like TextMate:

sudo vi /etc/profile
# add /Developer/Qt-4.x.x/bin to your path.

Then you should be in pretty good shape.

Building mchelper

First, you'll want to grab the source for mchelper. You can do this either by grabbing the HEAD of the SVN repository, or downloading a .zip archive of the source for the last release. To checkout a copy of the latest source via SVN, you'll issue a command like

svn co https://makingthings.svn.sourceforge.net/svnroot/makingthings/mchelper/trunk

Or you can browse the mchelper downloads on the Make Controller SourceForge page here.

Windows

I've used Eclipse as an IDE for Qt apps and it's worked quite nicely. There's a little bit of monkeying involved to set it up, however, so be prepared.

To add...

  • setting up the workspace
  • adding qmake as an external tool

OS X

Trolltech has made it extra easy to work with Qt apps on OS X by providing a simple way to generate Xcode projects for a group of files. This is what I've done, and it's worked great. To do this, in the Terminal:

# head to wherever you downloaded the mchelper source to
cd /path/to/mchelper/source
# build the Xcode project
qmake -spec macx-xcode mchelper.pro

Note that any time you add files to the project, you'll need to also add them to the project file - mchelper.pro - and regenerate the Xcode project.

Code Your Heart Out

You should be all set now to build and modify mchelper as you see fit. To get a sense of where we'd like to go with mchelper, check milestone:"mchelper 1.3". Or, if you have other ideas, please consider sharing!