Re: Newbie: Howto convert qmake project to cmake
Aron Boström wrote: Hi experts! I have a problem I have tried to solve for allmost a week now without success. In /trunk/KDE/kdepim/views/conversationview I have the code of my qmake-based SoC project. It's at the moment Qt4 only, but that is about to change. So I need to make it build with cmake. However, I can't. When linking my executable i get undefined reference to 'vtable for EverySingleClassName'. I have tried to copy and edit CMakeLists.txts from many places in kdepim, kdelibs and kdebase, as well as tried the same with Qt's hello world tutorials. As long as I only have one sourcefile (main.cpp) everything works just fine, but when I extends the solution to two source files (set (my_SRC main.cpp widget.cpp)) I bang my head into the wall. Regards, Aron Boström Could you post the cmake file, without it it's hard to help. Peter ___ Kde-buildsystem mailing list Kde-buildsystem@kde.org https://mail.kde.org/mailman/listinfo/kde-buildsystem
Re: Re: Newbie: Howto convert qmake project to cmake
Original-Nachricht Datum: Tue, 11 Jul 2006 08:10:13 -0400 Von: William A. Hoffman [EMAIL PROTECTED] An: kde-buildsystem@kde.org Betreff: Re: Newbie: Howto convert qmake project to cmake At 07:50 AM 7/11/2006, Aron Boström wrote: Hi experts! I have a problem I have tried to solve for allmost a week now without success. In /trunk/KDE/kdepim/views/conversationview I have the code of my qmake-based SoC project. It's at the moment Qt4 only, but that is about to change. So I need to make it build with cmake. However, I can't. When linking my executable i get undefined reference to 'vtable for EverySingleClassName'. I have tried to copy and edit CMakeLists.txts from many places in kdepim, kdelibs and kdebase, as well as tried the same with Qt's hello world tutorials. As long as I only have one sourcefile ( main.cpp) everything works just fine, but when I extends the solution to two source files (set (my_SRC main.cpp widget.cpp)) I bang my head into the wall. It sounds like you are not running moc, that will cause undefined vtables in qt projects. No, it's the old qmake vs. autotools way to include moc files. qmake adds the moc-files to it's sources and compiles them separatly. autotools/ cmake needs them to be included in the sources with #include mySource.moc Also take care that they're named differently qmake: moc-header: moc_filename.cpp moc-source: filename.moc autotools: moc-header: filename.moc moc-source: don't know atm, maybe filename_moc.cpp ? Christian -- Echte DSL-Flatrate dauerhaft für 0,- Euro*! Feel free mit GMX DSL! http://www.gmx.net/de/go/dsl ___ Kde-buildsystem mailing list Kde-buildsystem@kde.org https://mail.kde.org/mailman/listinfo/kde-buildsystem
Re: Newbie: Howto convert qmake project to cmake
On 7/11/06, Peter Kümmel [EMAIL PROTECTED] wrote: Could you post the cmake file, without it it's hard to help.PeterYeah, obviously, forgot that ;) This is the most recent file i tried. -- project(conversationview)find_package(KDE4 REQUIRED)include (KDE4Defaults)include_directories (${KDE4_KDECORE_INCLUDES} ${QT_INCLUDES})add_definitions (${KDE4_DEFINITIONS} ${QT_DEFINITIONS}) link_directories (${KDE4_LIBRARIES})set ( conversationSourcesmain.cppmessage.cppmailview.cppfoldermodel.cppdummykonadiadapter.cppconversationdelegate.cppconversation.cpp) kde4_automoc( ${conversationSources} )kde4_add_executable(conversationview ${conversationSources})target_link_libraries (conversationview ${KDE4_KDECORE_LIBS} ) ___ Kde-buildsystem mailing list Kde-buildsystem@kde.org https://mail.kde.org/mailman/listinfo/kde-buildsystem
qdbus on windows
How should we handle qdbus for windows? Currently qdbus depends on dbus and kdewin32. The kdewin32 dependency could be removed, because only getopt from unistd.h is needed by the tools. Does Trolltech plan to remove the dependency on unistd.h? The simples way is a copy paste from kdewin32, but I think there is a better Qt-way for this. And how should we build qdbus on windows? Is it possible to have a qmake build-process which ships with Qt and only depends on a enviroment variable for dbus? Something like this in tools/qdbus/src/src.pro: win32 { INCLUDEPATH += . $$(DBUSDIR)/include LIBS += $$(DBUSDIR)/lib/dbus-1.lib ws2_32.lib advapi32.lib netapi32.lib } Is it OK when I change the qt-copy files? Peter ___ Kde-buildsystem mailing list Kde-buildsystem@kde.org https://mail.kde.org/mailman/listinfo/kde-buildsystem
Re: Newbie: Howto convert qmake project to cmake
On Tuesday 11 July 2006 14:37, Aron Boström wrote: On 7/11/06, Christian Ehrlicher [EMAIL PROTECTED] wrote: No, it's the old qmake vs. autotools way to include moc files. qmake adds the moc-files to it's sources and compiles them separatly. autotools/ cmake needs them to be included in the sources with #include mySource.moc Yep. That made the qt tutorial work. Thanks! Aron If you don't want to use automoc, you can also use qt4_wrap_cpp(conversationSources file1_to_be_moced.h file2_which_needs_moc.h ... ) This will do basically the same, but the moc files will be compiled as separate files and you don't have to include them in the other source files. Pro: -cmake runs faster, since it doesn't have to check all source files for include blah.moc Con: -compilations is slower Bye Alex -- Work: alexander.neundorf AT jenoptik.com - http://www.jenoptik-los.de Home: neundorf AT kde.org- http://www.kde.org alex AT neundorf.net - http://www.neundorf.net ___ Kde-buildsystem mailing list Kde-buildsystem@kde.org https://mail.kde.org/mailman/listinfo/kde-buildsystem
Re: qdbus on windows
On Tuesday 11 July 2006 18:57, Peter Kümmel wrote: How should we handle qdbus for windows? Currently qdbus depends on dbus and kdewin32. The kdewin32 dependency could be removed, because only getopt from unistd.h is needed by the tools. Does Trolltech plan to remove the dependency on unistd.h? The simples way is a copy paste from kdewin32, but I think there is a better Qt-way for this. And how should we build qdbus on windows? Is it possible to have a qmake build-process which ships with Qt and only depends on a enviroment variable for dbus? Something like this in tools/qdbus/src/src.pro: win32 { INCLUDEPATH += . $$(DBUSDIR)/include LIBS += $$(DBUSDIR)/lib/dbus-1.lib ws2_32.lib advapi32.lib netapi32.lib } Is it OK when I change the qt-copy files? This topic fits *much* better on kde-core-devel, please post again there. Bye Alex -- Work: alexander.neundorf AT jenoptik.com - http://www.jenoptik-los.de Home: neundorf AT kde.org- http://www.kde.org alex AT neundorf.net - http://www.neundorf.net ___ Kde-buildsystem mailing list Kde-buildsystem@kde.org https://mail.kde.org/mailman/listinfo/kde-buildsystem