Place generated moc files into subfolders
-
I have a Qt project divided into subfolders using .pri files.
For example, I use the following structure
project/ |_project.pro |_include/ |_foo/ |_foo.pri |_file1.h |_bar/ |_bar.pri |_file2.h |_src/ |_foo/ |_foo.pri |_file1.cpp |_bar/ |_bar.pri |_file2.cppI am then using the
CONFIG += object_parallel_to_sourceoption in my .pro file to generate the .o files in their respective directories. The reason I do this is because files in different directories may have the same names (and may contain classes with the same names BUT in different namespaces).
However, when the moc runs on this project, it places all of the moc_*.cpp files in the same directory. This causes a problem in the case I mentioned above where files have the same name.
Is there a way to make qmake/moc generate the moc source files into the appropriate subdirectories just like the object files?
-