Replace qt4_automoc with qt4_wrap_cpp

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.

The goal of this post is that you could merge my patch if you want, is here[2].
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
[2] https://projects.archlinux.org/svntogit/packages.git/tree/trunk/replace-qt4_automoc-with-qt4_wrap_cpp.patch?h=packages/avogadro


Andrea

Marcus,

Could you skim through the CMake changes here? I’ll throw this up on
Gerrit if everything looks ok to you.

Dave

On Tue, Nov 29, 2011 at 3:43 PM, Andrea Scarpino andrea@archlinux.org wrote:

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.

The goal of this post is that you could merge my patch if you want, is here[2].
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
[2] https://projects.archlinux.org/svntogit/packages.git/tree/trunk/replace-qt4_automoc-with-qt4_wrap_cpp.patch?h=packages/avogadro


Andrea


All the data continuously generated in your IT infrastructure
contains a definitive record of customers, application performance,
security threats, fraudulent activity, and more. Splunk takes this
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d


Avogadro-devel mailing list
Avogadro-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/avogadro-devel

Hi,

I meant to reply, in principle this sounds great, and I did a lot of
this in master already I think. So I am good with the change, but
would like to run it through review. I will have some time, and want
to make a 1.1 release. If there is code, I am happy to also make a
1.0.4 release.

Marcus

On Tue, Dec 13, 2011 at 12:05 PM, David Lonie loniedavid@gmail.com wrote:

Marcus,

Could you skim through the CMake changes here? I’ll throw this up on
Gerrit if everything looks ok to you.

Dave

On Tue, Nov 29, 2011 at 3:43 PM, Andrea Scarpino andrea@archlinux.org wrote:

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.

The goal of this post is that you could merge my patch if you want, is here[2].
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
[2] https://projects.archlinux.org/svntogit/packages.git/tree/trunk/replace-qt4_automoc-with-qt4_wrap_cpp.patch?h=packages/avogadro


Andrea


All the data continuously generated in your IT infrastructure
contains a definitive record of customers, application performance,
security threats, fraudulent activity, and more. Splunk takes this
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d


Avogadro-devel mailing list
Avogadro-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/avogadro-devel

On Tue, Dec 13, 2011 at 12:10 PM, Marcus D. Hanwell
mhanwell@gmail.com wrote:

Hi,

I meant to reply, in principle this sounds great, and I did a lot of
this in master already I think. So I am good with the change, but
would like to run it through review. I will have some time, and want
to make a 1.1 release. If there is code, I am happy to also make a
1.0.4 release.

I’ve pushed this patch to gerrit:

http://review.source.kitware.com/#change,3498

Compilation currently fails with python disabled. This is probably a
simple matter of moving some source files into a new cmake list (e.g.
all of the python files are in
libavogadro/CMakeLists.txt:libavogadro_MOC_HDRS by default). I don’t
have enough free time these days to fix this up, but at least the
patch won’t be forgotten now that it’s in gerrit.

Dave

Marcus

On Tue, Dec 13, 2011 at 12:05 PM, David Lonie loniedavid@gmail.com wrote:

Marcus,

Could you skim through the CMake changes here? I’ll throw this up on
Gerrit if everything looks ok to you.

Dave

On Tue, Nov 29, 2011 at 3:43 PM, Andrea Scarpino andrea@archlinux.org wrote:

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.

The goal of this post is that you could merge my patch if you want, is here[2].
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
[2] https://projects.archlinux.org/svntogit/packages.git/tree/trunk/replace-qt4_automoc-with-qt4_wrap_cpp.patch?h=packages/avogadro


Andrea


All the data continuously generated in your IT infrastructure
contains a definitive record of customers, application performance,
security threats, fraudulent activity, and more. Splunk takes this
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d


Avogadro-devel mailing list
Avogadro-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/avogadro-devel