One way of doing it is to have a .pro file per subdirectory.
appsuite.pro:
TEMPLATE = subdirs
SUBDIRS = common app1 app2 app3
app1.depends = common
app2.depends = common
app3.depends = common
app1/app1.pro:
TARGET = app1
SOURCES = main.cpp
INCLUDEPATH += ../common
LIBS += -L../common -lcommon
The common.pro file should build a static library you can then link into the binaries.
common/common.pro:
TEMPLATE = lib
CONFIG = staticlib
SOURCES = project.cpp more.cpp
HEADERS = project.h more.h
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…