« Metrics Wii and OpenCV | Main | WebKit-based Spider »

Compiling WebKitQt on Mac OS X

After much pain and agony, I have finally figured out how to build WebKitQt and QtLauncher (the demo app) on Mac OS X.

It's probably not supposed to be this hard, but there's a dearth of info on how to do this (I suspect because the guys at Trolltech are busy trying to get Qt 4.3 out the door).

In any case, I wanted to use WebKit in a spidering app I'm working on using Qt 4.3 and C++. Even though I am a 100% Mac-based developer these days, I still want my apps to be cross-platform, so I opt for Qt over Cocoa/Objective-C. This meant that I had to follow the Apple/XCode dylib rules as well as install a few libraries that weren't on my system by default.

1 - Using fink, I installed flex and bison (separate installs).
2 - Then I had to specify QTDIR environment variable (QTDIR=/usr/local/Trolltech/Qt-4.3.0beta) (then export QTDIR)
3 - add QTDIR to your PATH environment variable (PATH=$PATH:$QTDIR/bin) (then export PATH)
4 - make sure you have NOT specified a QMAKESPEC in your bash profile (so echo $QMAKESPEC should not return anything)
5 - grab the latest WebKit source using SVN (see webkit.org for instructions)
6 - run ./WebKit/WebKitTools/Scripts/build-webkit

This should make the build script compile using qmake.

7 - copy the dylibs from /WebKit/WebKitBuild/Release/lib to /usr/lib

QtLauncher should now run (located in /WebKit/WebKitBuild/Release/WebKitQt/QtLauncher).

In order to compile/edit this in xcode...

8 - in a terminal window - cd into /WebKit/WebKitQt/QtLauncher/
9 - run the following"qmake -spec macx-xcode"

You should now see QtLauncher.xcodeproj in that directory.

You may have to manually delete and re-add some of the Qt libraries in XCode, as well as adding the QtNetwork.framework, since I don't think it's added by default.

I'm sure I missed some of the details (since I typed this rather quickly), but this captures many of the small steps that tripped me up along the way.

TrackBack

TrackBack URL for this entry:
http://s159415912.onlinehome.us/mt/mt-tb.cgi/16

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

About

This page contains a single entry from the blog posted on April 3, 2007 1:11 PM.

The previous post in this blog was Metrics Wii and OpenCV.

The next post in this blog is WebKit-based Spider.

Many more can be found on the main index page or by looking through the archives.

Creative Commons License
This weblog is licensed under a Creative Commons License.
Powered by
Movable Type 3.32