cryos/avogadro — pull request #2 by bashlnx (2011-11-30 08:22:48+00:00)
Title: 1.0

Hi Avogadro team,
I'm the avogadro maintainer in Arch Linux.

We are updating boost to 1.48.0, but Qt moc has a bug with this boost version (you can find more info here[1]).
Avogadro uses moc, so avogadro has this bug too. In fact when you build avogadro 1.0.3 with boost 1.48.0 you get:

[ 4%] Generating pythonextension_p.moc
usr/include/boost/type_traits/detail/has_binary_operator.hp:50: Parse error at "BOOST_JOIN"
make[2]: *** [libavogadro/src/pythonextension_p.moc] Error 1
make[1]: *** [libavogadro/src/CMakeFiles/avogadro.dir/all] Error 2

In the qt bug report an user said that passing a specific option to moc the bug can be avoided.
But the only one method to pass some option to moc in cmake is the QT4_WRAP_CPP macro.
You use this macro in the libavogadro/CMakeLists.txt, but you don't in libavogadro/src/CMakeLists.txt and libavogadro/src/python/CMakeLists.txt; you use qt4_automoc there.
So I replaced qt4_automoc usage with the qt4_wrap_cpp macro in those CMakeLists.txt.

You would merge my commit.
Note, I had to move the ReadFileThread class declaration in another header (moleculefile_p.h) to make the macro work.

Cheers.

[1] https://bugreports.qt.nokia.com/browse/QTBUG-22829