kdesupport/qt-dbus/examples

Peter Kümmel syntheticpp at gmx.net
Thu Jun 1 09:56:40 CEST 2006


Hi Brad, thanks for your immediate answer!

Brad King wrote:
>> SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/chatinterface.moc
>> GENERATED)
> 
> You shouldn't need the GENERATED property.  That is automatically added
> by ADD_CUSTOM_COMMAND because the files are outputs.
> 

Yes, you are right I could remove them.
(Yesterday I got some errors before I've cleaned up the code for the post)

>> +       SET(chat_SRCS ${chat_SRCS} chatmainwindow.h chatsetnickname.h
>> chatinterface.moc )
> 
> Adding the output of a custom command to the list of sources should be
> enough to pull it in.
> 
>> +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?
> 
> CMake cannot know that chatmainwindow.h will be used in the chat target
> unless you add it, just like any *source* file.  It is different from
> other *header* files because it is generated and does not exist initially.
> 

Ok, it's not a bug, but at least a difference to the other generators
(no problems with nmake, unix), where it is not necessary to add these
files to the source variable.

>> Can I apply this patch, even if it's a work around (around cmake or my
>> limited cmake knowlege)
> 
> Please try it without the explicit GENERATED mark.
> 
> -Brad
> 
> 

I've checked in this:

Index: examples/CMakeLists.txt
===================================================================
--- examples/CMakeLists.txt     (Revision 547079)
+++ examples/CMakeLists.txt     (Arbeitskopie)
@@ -85,6 +85,8 @@
                set(DBUSIDL2CPP_PROGRAM ${CMAKE_BINARY_DIR}/tools/dbusidl2cpp.exe)
        else(NOT MSVC_IDE)
                set(DBUSIDL2CPP_PROGRAM ${CMAKE_BINARY_DIR}/tools/$(OutDir)/dbusidl2cpp.exe)
+               # add this files to chat_SRCS when there are problems with other generators
+               set(chat_SRCS ${chat_SRCS} chatmainwindow.h chatsetnickname.h chatinterface.moc )
        endif(NOT MSVC_IDE)
 else(WIN32)
        set(DBUSIDL2CPP_PROGRAM ${CMAKE_CURRENT_BINARY_DIR}/../tools/dbusidl2cpp)


More information about the Kde-buildsystem mailing list