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 <<

Reply via email to