Boost.Build/bjam and Qt

I am trying to configure the Boost.Build.jamroot file to compile a Qt 4.8 project, but it seems to ignore the .up files and the .cpp files, which should be moc: ed. I tried scrolling inside qt4.jam, adding a few more ECHO: s, but I'm not sure where to look.

It seems that the run uic-generator method is not called (like init), but I think it should be.

My jamroot file looks something like this:

import qt4 ; if ! [ qt4.initialized ] { ECHO "oh nooo" ; } import cast ; exe application : # For example [ cast _ moccable-cpp : ./src/something.cpp ] [ glob-tree *.ui : .svn ] ; 

The only way I get:

 >bjam warn: Unable to construct ./application ...found 1 target... 

If I run bjam -debug-configuration, qt4.jam displays all the correct paths for my Qt installation.

What? Maybe this is incompatible with Qt 4.8? Or am I just using it the wrong way? Although the code is almost verbatim from the files under / qt examples.

How can i use it? Thanks for any help.

Edit: Using gcc 4.7 with MinGW distro 9.0 from http://nuwen.net/mingw.html and Boost.Build, which comes with Boost 1.49.0.

+8
c ++ qt bjam
source share
2 answers

replace. / src / something. cpp on. / src / something. hpp , i.e .:

 [ cast _ moccable-cpp : ./src/something.hpp ] 

bjam qt examples tend to be misunderstood: the main.cpp module mixes the source files and .

Remember the moc process header files usually (files with the declaration of the Q_OBJECT class: in most cases, the source files do not contain it)

+1
source share

Inaccurate answer to your question, but suggestions: How about using qmake? It is also suitable for regular C ++ assemblies. If you use a lot of Qt, qmake is very convenient, although the documentation can be improved.

Cm.

http://labs.qt.nokia.com/2008/04/16/the-power-of-qmake/

http://doc.qt.nokia.com/4.4/qmake-manual.html

http://www.qtcentre.org/wiki/index.php?title=Undocumented_qmake

http://paulf.free.fr/undocumented_qmake.html

http://www.kde.gr.jp/~ichi/qt/qmake-manual-6.html

for further links

0
source share

All Articles