[Interest] [Qt-interest] cmake: ui library?

Stefan Majewsky stefan.majewsky at googlemail.com
Tue Feb 14 00:56:22 CET 2012


On Mon, Feb 13, 2012 at 10:16 PM, Rui Maciel <rui.maciel at gmail.com> wrote:
> Then, I proceeded to pass libui to the TARGET_LINK_LIBRARIES() command and
> add ${libui_HEADERS} to the projec_HEADERS list.
>
> Yet, when I try to compile the project, the compiler throws a series of
> errors about "undefined reference to `vtable for <ui class name here>'".

Looks like the moc files are missing in your picture. Since you're
probably just starting, you should read about the automoc
functionality which was recently introduced into CMake. A long
introduction is at http://blogs.kde.org/node/4495 but in your case,
the quick answer should be

set(CMAKE_AUTOMOC TRUE)

Probably before add_library(). Have not tried it though, see the
linked article for details.

> So, does anyone know how to setup cmake to churn out a static library from
> Qt code?

add_library(foobar STATIC ${foobar_SOURCES})

Greetings
Stefan

P.S. Remember to change your subscription to the new list at
interest at qt-project.org.



More information about the Interest mailing list