[CMake] AUTOMOC does not process headers in subdirectory of include/

Mario Emmenlauer mario at emmenlauer.de
Wed Apr 10 08:48:18 EDT 2019


Dear all,

we have a problem that Qt moc is only called for headers in the
include directory of the project, not for subdirectories. Attached
is a minimal example. cmake should call moc to generate the moc-
sources in MyQtWidgets_autogen/include/bda/ folder. However the
sources are not generated. When I move the header out of the
subdirectory (from include/bda/CollapsibleDockWidget.hh to
include/CollapsibleDockWidget.hh) and fix the include path in the
source files, then moc works correctly.

I think this is wrong, but I could not find explicit documentation
about how the headers and sources are set for moc (see [1]).

Does cmake not respect the headers listed with add_library()?
Or is there something else I'm doing wrong?

All the best,

    Mario Emmenlauer

[1] https://cmake.org/cmake/help/latest/prop_tgt/AUTOMOC.html



--
BioDataAnalysis GmbH, Mario Emmenlauer      Tel. Buero: +49-89-74677203
Balanstr. 43                   mailto: memmenlauer * biodataanalysis.de
D-81669 München                          http://www.biodataanalysis.de/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MyQtWidgets.tar.gz
Type: application/gzip
Size: 1911 bytes
Desc: not available
URL: <https://cmake.org/pipermail/cmake/attachments/20190410/941438dc/attachment.gz>


More information about the CMake mailing list