The Fugue Counterpoint by Hans Fugal

26Mar/0813

QCad on Leopard

I finally got around to building QCad on OS X Leopard. There are two main hurdles: getting Qt3 to build and getting QCad to build.

At first I tried building Qt3 with macports, but building QCad was a royal pain with the X11 version of Qt3 on OS X, for whatever reason. So I tried to install the qt3-mac MacPorts package, but that failed. So I was on my own building Qt3.

This patch will allow Qt3 to build on Leopard, by following the instructions in the INSTALL file. Here's the diffstat:

 config.tests/mac/mac_version.test |    2 +-
 src/kernel/qcursor_mac.cpp        |    4 ++++
 src/kernel/qt_mac.h               |    2 +-
 src/tools/qglobal.h               |    5 ++++-
 4 files changed, 10 insertions(+), 3 deletions(-)

I put it in /Developer/qt3, and I wrote a script to source on demand rather
than setting QTDIR and friends in my .profile or .bashrc, since I more
often want Qt4 than Qt3. I configure with -static, so applications like QCad
are built with Qt3 statically, which just makes things work better.

QCad needs a patch as well:

Index: qcad-2.0.5.0-1-community.src/mkspecs/defs.pro
===================================================================
--- qcad-2.0.5.0-1-community.src.orig/mkspecs/defs.pro  2008-03-26 08:46:25.000000000 -0600
+++ qcad-2.0.5.0-1-community.src/mkspecs/defs.pro       2008-03-26 08:46:48.000000000 -0600
@@ -1,6 +1,6 @@
 # $Id: defs.pro 606 2004-12-25 03:08:40Z andrew $
-QMAKE_CXXFLAGS_DEBUG += -pedantic
-QMAKE_CXXFLAGS += -pedantic
+#QMAKE_CXXFLAGS_DEBUG += -pedantic
+#QMAKE_CXXFLAGS += -pedantic

 win32 {
   QMAKE_CFLAGS_THREAD -= -mthreads
Index: qcad-2.0.5.0-1-community.src/scripts/build_qcad.sh
===================================================================
--- qcad-2.0.5.0-1-community.src.orig/scripts/build_qcad.sh     2008-03-26 08:46:06.000000000 -0600
+++ qcad-2.0.5.0-1-community.src/scripts/build_qcad.sh  2008-03-26 08:46:49.000000000 -0600
@@ -30,7 +30,7 @@ then
     export MAKE=gmake
     echo "Platform is Solaris"
     platform=solaris
-elif [ "x$OSTYPE" == "xdarwin8.0" ]
+elif [ "x$OSTYPE" == "xdarwin8.0" -o "x$OSTYPE" == "xdarwin9.0" ]
 then
     export MAKE=make
     echo "Platform is Mac OS X"

Then do

cd scripts
./build_qcad.sh notrans

It will complain about not finding qm/*.qm, but that's a nonfatal error.
QCad.app will be in the qcad directory, ready for your use.

I built this on an Intel MacBook running Leopard. If you think that matches
your setup, you're free to download my QCad.app and avoid
building both Qt3 and QCad.

Comments (13) Trackbacks (0)
  1. Dear Hans
    Your QCad.app works fine on Intel IMac.

    Many Thanks
    Brian Corry, Ireland

  2. Great Job!!
    I want to be a Hacker like you.
    Thank you!

    Moto Hanada, Japan

  3. Thank you for enabling my laziness.

  4. Thank you. Works nice on macbook 10.5.5

  5. Hans – this is awesome, thank you!

  6. I am in your debt! Thanks!

  7. Perfect! Thanx a lot

  8. thanks a lot.
    i had a quick at building it myself and had all sorts of problems
    xD

  9. Have you ever considered contributing to macports? I don’t know how long this took you, but the product is evidently suitable and functional on a number of OS versions and machines. We need people like you to make open source applications mac friendly. Great job!

  10. I’ve done enough Tcl for one lifetime. But I’d be happy to work closely with any macports masochist^Wdeveloper in providing patches, helping test, etc.

    Also I tend to use Qt directly and not from macports, which compounds the development environment problem.

  11. Thanks Hans, appears to be working fine on 10.6.3 (Intel MacBook).

  12. Hans,

    do you have experience with debugging QCad on OSX? I am trying to make this work from NetBeans but I cannot seem to make it break.

    Compiling works fine, and running the app also!

    I am trying make some additions to it, and I am at the point where I need more insight on some objects.

    Ries

  13. Hans, I got it running using X-Code, with netbeans apparently I could get it later to debug, but it would just hang at some points (stack issues). With X-Code I could make it work fine


Leave a comment


No trackbacks yet.