QCad.png

Looking for a program to view and edit .dxf files on the Mac I stumbled upon QCad from Ribbonsoft. This allows you to view and edit Autocad DXF files.

Compiling QCad

Although the QCad source is under GPL, only demo versions are availabale as binary. So, compiled QCad from source. Follows the list and some links I used to get QCad compiled under OS X 10.4.11 with gcc-4.0 (and using a MacPorts QT3 installation, present from previous MacPort installed sw)

### install the QT3 package with MacPorts.
### You are expected to be familiar with MacPorts
### and have it installed
$ ssh -l yourAdminUser localhost
## this is used to logon as admin from within an
## ordinary user terminal session
$ sudo port selfupdate
$ sudo port install qt3
...
### compile QCad
$ cd /opt/local
$ sudo mkdir qcad
$ sudo cp /Users/yourUserId/Desktop/QCad/qcad-2.0.5.0-1-community.src.tar.gz .
$ tar xfz qcad-2.0.5.0-1-community.src.tar.gz
$ rm qcad-2.0.5.0-1-community.src.tar.gz
### to prevent "qmacstyle_mac.h: No such file or directory" error,
### applied patch manually (as patch raised errors) by commenting
### out (with vi) in src/main.cpp:
//#ifdef __APPLE__
//#include
//#endif:
...
//#ifdef __APPLE__
// QApplication::setStyle(new QMacStyle());
//#endif
...
$ export QTDIR=/opt/local/lib/qt3 ## MacPorts QT3 location
$ export QMAKESPEC=/opt/local/lib/qt3/mkspecs/macx-g++
$ cd scripts
$ ./build_qcad.sh notrans

Running QCad

Doubleclik QCad.app or start from terminal window:

$ open /opt/local/qcad/qcad-2.0.5.0-1-community.src/qcad/QCad.app

Compile QCad under OS X 10.5.8

$ cd /opt/local/qcad/qcad-2.0.5.0-1-community.src/scripts/
$ sudo vi build_qcad.sh # set Qt vars in build script (setting environment vars didn't work for me)
export QTDIR=/opt/local/lib/qt3
export QMAKESPEC="/opt/local/lib/qt3/mkspecs/macx-g++"
export PATH=$QTDIR/bin:$PATH
$ sudo vi ../qcadlib/src/engine/rs_entity.cpp # edit or apply this <a href="http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=288190">Debian patch</a>
- os &lt;&lt; " layer address: " &lt;&lt; (int)(e.layer) &lt;&lt; " ";
+ os &lt;&lt; " layer address: " &lt;&lt; (long)(e.layer) &lt;&lt; " ";
$ sudo vi ../qcadlib/src/engine/rs_layer.cpp # same
- &lt;&lt; " address: " &lt;&lt; (int)(&amp;l)
+ &lt;&lt; " address: " &lt;&lt; (long)(&amp;l)
$ sudo vi ../qcad/src/qc_applicationwindow.cpp # fix Help info (Qt assistant is in /opt/local/bin/qt3 which is part of the $PATH set)
- assistant = new QAssistantClient(RS_SYSTEM-&gt;getAppDir()+"/bin", this);
+ assistant = new QAssistantClient("", this);
$ sudo rm ../dxflib/src/*.o; # clean .app and all object files
$ sudo rm ../fparser/src/*.o;
$ sudo rm ../qcad/src/obj/*.o;
$ sudo rm ../qcadactions/src/obj/*.o;
$ sudo rm ../qcadcmd/src/obj/*.o;
$ sudo rm ../qcadguiqt/src/obj/*.o;
$ sudo rm ../qcadlib/src/obj/*.o;
$ sudo rm -R ../qcad/QCad.app;
$ sudo ./build_qcad.sh notrans # build QCad