Building qfsm on Ubuntu 8.04

I just tried to build qfsm on Ubuntu 8.04. The only dependencies listed by qfsm are CMake and Qt 4.3.x – both of which are available through the Ubuntu packet manager.

However, when I followed the instructions provided along with the qfsm source code, I encountered this error message:

[ 41%] Building CXX object CMakeFiles/qfsm.dir/src/ExportAHDLDlgImpl.o
In file included from qfsm-0.51.0-Source/src/ExportAHDLDlgImpl.h:21,
                 from qfsm-0.51.0-Source/src/ExportAHDLDlgImpl.cpp:21:
qfsm-0.51.0-Source/src/ui_ExportAHDLDlg.h:27: error: expected constructor, 
  destructor, or type conversion before ‘class’
make[2]: *** [CMakeFiles/qfsm.dir/src/ExportAHDLDlgImpl.o] Error 1
make[1]: *** [CMakeFiles/qfsm.dir/all] Error 2
make: *** [all] Error 2

It turns out that the definition of the QT_BEGIN_NAMESPACE macro was nowhere to be found on my system. Luckily, removing the corresponding lines in the qfsm source code allowed me to build the code just fine. I used this one-liner to remove the offending lines:

$ for file in `grep -R QT_BEGIN_NAMESPACE * | awk -F : '{ print $1; }'` ; 
  do sed -i -e '/QT_.*NAMESPACE/d' $file ; done