kdesupport/qt-dbus/examples

Peter Kümmel syntheticpp at gmx.net
Wed May 31 23:18:13 CEST 2006


Thiago Macieira wrote:
> Peter Kümmel wrote:
>> build example/chat also on windows: fix dbusidl2cpp.exe usage with
>> nmake. using the IDE is still broken because chatinterface.moc and
>> chatmainwindow.h are not generated. this is baybe a cmake BUG.
> 
> There are hardcoded rules to run uic and moc for those files. 
> FindQt4.cmake doesn't provide any uic-related macros.
> 

I think it is a CMake bug of the Visual Studio 8 2005 generator,
because the other generators have no problem.
I have to add this patch to compile chat with the IDE:

Index: examples/CMakeLists.txt
===================================================================
--- examples/CMakeLists.txt     (Revision 547079)
+++ examples/CMakeLists.txt     (Arbeitskopie)
@@ -72,6 +72,12 @@
        chat.h
        chatadaptor.cpp
 )
+if(MSVC_IDE)
+       SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/chatmainwindow.h GENERATED)
+       SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/chatsetnickname.h GENERATED)
+       SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/chatinterface.moc GENERATED)
+       SET(chat_SRCS ${chat_SRCS} chatmainwindow.h chatsetnickname.h chatinterface.moc )
+endif(MSVC_IDE)
 ADD_CUSTOM_COMMAND(OUTPUT chatmainwindow.h
                   COMMAND ${QT_UIC_EXECUTABLE}
                   ARGS -o chatmainwindow.h ${CMAKE_CURRENT_SOURCE_DIR}/chatmainwindow.ui


Why must I do it by hand? Couldn't it be figured out by cmake?

Can I apply this patch, even if it's a work around (around cmake or my limited cmake knowlege)

Peter

P.S.:
Maybe the CMake experts do know what here would be best. :)


More information about the Kde-buildsystem mailing list