Boost.Build/bjam and Qt
Asked Answered
V

2

8

I'm trying to set up a Boost.Build .jamroot file for compiling a Qt 4.8 project, but it seems to be ignoring the.ui files and the .cpp files that should be moc:ed. I tried poking around inside qt4.jam, adding some more ECHO:s, but I'm not sure where to look.

It seems that the run method of uic-generator doesn't get called (init does), for example, 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 output I get is:

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

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

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

How can I use it? Thanks for any help.

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

Venal answered 30/4, 2012 at 12:20 Comment(1)
I've seen Qt applications build with bjam Version 3.1.11 and Qt 4.7. I'd be very surprised if it were impossible with bjam Version 3.1.19 (from Boost 1.49.0) and Qt 4.8. Unfortunately, I don't really understand much of the Jam language myself.Tinsmith
L
1

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

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

bjam 's qt-examples tend to misunderstanding: main.cpp module mix up source and header files.

Let's remember moc process header files usually (files with Q_OBJECT 's class declaration(s): in most cases source files doesn't contain its)

Lintel answered 13/4, 2013 at 14:9 Comment(0)
C
0

Not an exact answer to your question but a suggestions: What about using qmake ? It is also suitable for normal c++ builds. If you use a lot of Qt, qmake is pretty handy, although the documentation could be improved.

See

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 references

Claustrophobia answered 5/6, 2012 at 9:30 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.