Hmmm, I have tried your solution (also including myfile.moc at the end of
the .cpp file), but it complains about undefined references to vtable and it
does not compile...
A question related to compile the sources into the test executable: can I
use a variable created in a "parent" of the cmake file I'm currently using?
I would like not to hand-write twice a lot of source files, it would be
great if I only had to include a variable from the parent!
Thank you!

2011/1/28 Andreas Pakulat <ap...@gmx.de>

> On 28.01.11 13:13:58, Riccardo Bellini wrote:
> > Thank you all for your replies, however I would prefer using Qt functions
> > rather than kde4_add_unit_test.
> > I finally got it to work, but I had to split the test class in .h and
> .cpp
> > files, and call qt_wrap_cpp on header file, including mocs in sources
> when I
> > call add_executable.
>
> You could use the qt4_automoc macro which will handle QObject sublcasses
> inside .cpp as long as you #include "mycppfile.moc" (IIRC).
>
> > Another question: it's not a big problem, just for my knowledge. I had to
> > create a static library from my project source and link the test
> executable
> > against it, otherwise it gives some "undefined reference to". Is there a
> way
> > to get it without creating a library and link it?
>
> Sure, compile in the source files into the test-executable.
>
> Andreas
>
> --
> You now have Asian Flu.
>
> >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to
> unsubscribe <<
>
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<

Reply via email to