FILE(REMOVE) and FILE(APPEND) don't resolve relative filenames the same way

Thiago Macieira thiago at kde.org
Fri Mar 6 17:25:01 CET 2009


Brad King wrote:
>David Faure wrote:
>> => Before QT4_CREATE_MOC_COMMAND calls
>> FILE(REMOVE ${_moc_parameters_file}), could you make it check that
>> ${_moc_parameters_file} is an absolute path and not a relative one,
>> since that's bound to fail and give unexpected results?
>
>Please file a feature request in the bug tracker.
>
>> (And the reason for all this: there doesn't seem to be a way to
>> generate a foo.moc when foo.cpp defines a Q_OBJECT itself (rather than
>> the header file) and foo.cpp includes foo.moc. Well, kde4automoc
>> handles this, but I'm abusing this list to ask questions about a
>> qt-only project ;) ). So I wrote this macro macro(macro_included_moc
>> cppfile)
>>   GET_FILENAME_COMPONENT(_basename ${cppfile} NAME_WE)
>>   SET(_moc ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.moc)
>>   qt4_generate_moc(${cppfile} ${_moc})
>>   macro_add_file_dependencies(${cppfile} ${_moc})
>> endmacro(macro_included_moc)
>>
>> Alternative solution: including kde4automoc into cmake. I know we
>> discussed it in the past and it was rejected, but this is another
>> argument for it. My boss wouldn't let me add it as dependency, he
>> wanted an
>> "off-the-shelf cmake" solution: importing kde4automoc and integrating
>> it into the compilation properly sounded like a bit too much trouble
>> for a single cpp file that defined a Q_OBJECT...)
>
>If every Qt project needs something like this, wouldn't it make more
> sense for Qt itself to provide an executables with the capabilities of
> kde4automoc?

We do. They're called qmake and moc. (moc can be used to scan dependencies 
and qmake makes use of that).

-- 
  Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/kde-buildsystem/attachments/20090306/5d9f3c66/attachment.sig 


More information about the Kde-buildsystem mailing list