2011-12-09

Setting up CommonQt on OSX

CommonQt can be tricky to setup due to its dependencies from C++ land. Tricky enough to warrant writing down the steps I went through to get it running on Mac OS 10.7:

  1. If you don't already have Xcode, install it because you'll need g++.

  2. Grab and install the Qt Libraries (not the Qt SDK). I used version 4.7.4.

  3. Install CMake. (I used brew install cmake.)

  4. Download, compile and install the SMOKE library:

    $ git clone git://anongit.kde.org/smokegen
    $ cd smokegen
    $ cmake .
    $ make install
    
    $ cd ..
    $ git clone git://anongit.kde.org/smokeqt
    $ cd smokeqt
    $ cmake -DSmoke_DIR="$PWD/../smokegen/cmake" .
    $ make install
    

    At this point, smokephonon failed to build so I had to manually install the two modules I actually needed:

    $ make -C qtcore install
    $ make -C qtgui install
    
  5. Get an SBCL with threads enabled and Quicklisp.

  6. CommonQt needed a couple of tweaks for OSX and recent changes in SMOKE. While said changes aren't reviewed and integrated into the main repository, you can fetch them as follows:

    $ cd ~/quicklisp/local-projects
    $ git clone git://gitorious.org/~luismbo/commonqt/commonqt-luis.git
    $ cd commonqt-luis
    $ git checkout modular-smoke-and-osx-fixes
    
  7. Start SBCL and (ql:quickload :qt).

Hopefully that went well. Next we'll try and run an application.

  1. Enable the swank-listener-hooks contrib by adding (slime-require 'swank-listener-hooks) to your SLIME configuration.
  2. (asdf:load-system :qt-tutorial)
  3. (asdf:load-system :qt-repl)
  4. (qt-repl:start-gui-thread)
  5. And finally, (qt-tutorial-14::test)!

If not running under SLIME, (asdf:load-system :qt-tutorial) followed by (qt-tutorial-14:main) would be sufficient.

If you want to try and skip the C++ compilation steps, grab this tarball with libcommonqt.dylib and libsmoke*.dylib. You should place libcommonqt.dylib in CommonQt's source directory. The SMOKE libs go into /usr/local/lib or similar.

1 komento:

heretoo said...

In step 4, run cmake as follows to prevent errors when building phonon (disables phonon):

cmake -DWITH_Phonon=OFF -DSmoke_DIR="$PWD/../smokegen/cmake" .

Kategorioj