Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Boost.Build/bjam and Qt

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.

like image 357
tacospice Avatar asked Apr 30 '12 12:04

tacospice


1 Answers

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)

like image 192
junta Avatar answered Oct 16 '22 10:10

junta