[cmake-developers] Current deficiencies of automoc

Sebastian Holtermann seblist at xwmw.org
Mon Nov 14 07:25:18 EST 2016


Am 14.11.2016 um 12:41 schrieb Alan W. Irwin:
> On 2016-11-14 09:06+0100 Sebastian Holtermann wrote:
> 
>> What probably could be done is to add
>> ${CMAKE_BINARY_DIR}/${TARGETNAME}_automoc.dir
>> to the INCLUDE_DIRECTORIES of the target and then generate all
>> #included moc file there, accepting the risk of intra target name
>> collisions.
> 
> Hi Sebastian:
> 
> Your compromise idea above sounds good to me!
> 

Btw. I liked your
${CMAKE_BINARY_DIR}/
    ${TARGETNAME}_automoc.dir/
        ${HEADERPATHCHECKSUM}/
            moc_${HEADERNAME}.cpp
approach.

It could be used for the moc_<autoname>.cpp files that are not
manually #included and therefore can have any name.

Over the current
${CMAKE_BINARY_DIR}/
    ${TARGETNAME}_automoc.dir/
        moc_${HEADERNAME}_${HEADERPATHCHECKSUM}.cpp
scheme it has the advantages that
1) moc_<autoname>.cpp files are grouped by their source directory
2) ${HEADERNAME} is kept intact and does not get shortened
3) fewer weird looking checksum names ;)

1) and 2) are generally helpful to find and debug moced files I think.

There are a some other changes to the automoc system I would like to
propose / work on. I'm currently busy with an other project though.

-Sebastian




More information about the cmake-developers mailing list