Qt4 Tool: Won't moc header file not in the same dir as source file

Issue #5 resolved
repo owner created an issue

Originally reported by Francis Bolduc:

This bug report applies to the Qt4 tool.

This may be a feature request more than a bug.

When scanning a source file for header files that can be moc'ed, the tool will not search in the CPPPATH, but only in the same directory as the source file. This prevents the detection of header files in the situation where you have a typical library directory tree, such as:

include/ (which contains .h) src/ (which contains .cpp)

In the meanwhile, I invoke the Moc4 builder explicitely and everything works fine.

The problem is that the behavior is not the same as when you have a different directory tree. That is inconvenient.

Comments (3)

  1. dirkbaechle reporter


    I upgraded to revision #16 and tested it.

    I confirm that the problem is fixed my use case.

    I no longer need to invoke the Moc4 builder explicitly for header files containing the Q_OBJECT that are not in the same directory as the source files being built. Since those header files are in the CPPPATH, they are scanned and moc'ed.

    However, I did not test the QT4_AUTOMOC_CPPPATH variable that was also added in this revision, but I think it could be handy in some situations.

    Thanks Dirk!

  2. Log in to comment