(Apologies, I can't think of a better way of explaining except through including the following detail)
Pre-build structure:
F:\
└ Project\
└ Project.pro
└ ProjectSettings.pri
└ Source\
└ Source.pro
└ My_Library\
└ My_Library.pro
└ library.cpp
└ ...
Contents of "Project.pro":
TEMPLATE = subdirs
SUBDIRS = Source
Contents of "Source.pro":
TEMPLATE = subdirs
CONFIG += ordered
SUBDIRS += My_Library
Contents of "My_Library.pro":
include(../../ProjectSettings.pri)
TEMPLATE = lib
SOURCES += library.cpp
Contents of "ProjectSettings.pri"
TARGET = $$basename(_PRO_FILE_PWD_)
Debug:buildDir = "Debug"
Release:buildDir = "Release"
DESTDIR = $$PWD/$$buildDir/bin
OBJECTS_DIR = $$PWD/$$buildDir/$$basename(_PRO_FILE_PWD_)/obj
MOC_DIR = $$PWD/$$buildDir/$$basename(_PRO_FILE_PWD_)/moc
RCC_DIR = $$PWD/$$buildDir/$$basename(_PRO_FILE_PWD_)/rcc
UI_DIR = $$PWD/$$buildDir/$$basename(_PRO_FILE_PWD_)/gui
Post-build structure:
F:\
└ Project\
└ Project.pro
└ ProjectSettings.pri
└ Source\
└ Source.pro
└ My_Library\
└ My_Library.pro
└ library.cpp
└ Debug\
└ bin\
└ libMy_Library.a
└ My_Library\
└ moc\
└ obj\
└ library.o
└ My_Library\ <------ WTF
└ moc\
└ Release\
└ bin\
└ libMy_Library.a
└ My_Library\
└ moc\
└ obj\
└ library.o
Problem
The idea is
- run
qmake -recursive
in the Project folder - which builds all the specified sub-projects
- spits out a bunch of well organised intermediate files
- and places all the binaries for the sub-projects into one folder
- all of which are segregated based on Debug or Release scope
It seems to work brilliantly, except for an extra folder per 'sub-project' in the Project folder each of which contains a moc folder which I've highlighted "WTF"* above.
Questions
- Which (combination of) instruction(s) in the .pro files generates the "WTF" folders?
- What would the "WTF" folder be used for? (bearing in mind the Debug and Release scopes specify their own moc)
- Is there a way to prevent the "WTF" folders being created?
I don't have any source files that would cause the MOC to output moc files yet so all moc folders are empty at the moment.
* "WTF" = "What The Folder"