.pro file can specify a subdirs template. You may think to use subdirs template, you need to create sub directories and create sub project files in them. But actually you do not need to do so. Just create a subdirs .pro file and qmake can create a Makefile from it without problem even the sub-directories and sub .pro files does not exist yet. The following is a minimal .pro file with the subdirs template:
TEMPLATE = subdirs SUBDIRS = dir1 dir2
The created Makefile will include the following targets:
Most of the targets are just to enter a subdir and execute make -f Makefile there(if the Makefile does not exist, call qmake to generate it). So if the subdirectories/sub-projects have not been created yet, the make will fail. The Makefile target in the generated Makefile is kind of special. It depends not only on the .pro file but also on numerous .pri/ .prf files and qmake.conf in the mkspecs directory, and .qmake.stash(created by qmake) in current directory.
dir1, dir2, etc can have sub variables/child variables/member variables, e.g. dir1.target=myapp1. Then all sub-dir1-xxx targets in the generated Makefile will be replaced by myapp1-xxx. If you set dir1.subdir=mysubdir, all occurrences of dir1 will be replaced with mysubdir in the generated Makefile, e.g, sub-dir1-make_first will become sub-mysubdir-make_first. If you set dir1.file=myfile, all dir1s will be replaced by myfile and qmake assumes myfile is the name of the sub-directory. An important sub-variable is the depends variable. It will make all targets dependent on other targets. For example, dir1.depends=mydeps will create a prerequisite for sub-dir1 as follows:
sub-dir1: mydeps FORCE
So using .depends can create dependencies between sub-modules.