You use a subdirs project. For a simple example project.pro:
TEMPLATE = subdirs
SUBDIRS = foo bar app
CONFIG += ordered # makes sure libs foo and bar are built before app
TEMPLATE = subdirs
SUBDIRS = foo bar app
CONFIG += ordered # makes sure libs foo and bar are built before app
To copy to clipboard, switch view to plain text mode
with a source tree like:
- project.pro
+ foo
- foo.pro
- a.cpp
- etc...
+ bar
- bar.pro
- b.cpp
- etc...
+ app
- app.pro
- main.cpp
- mainwindow.cpp
- etc...
- project.pro
+ foo
- foo.pro
- a.cpp
- etc...
+ bar
- bar.pro
- b.cpp
- etc...
+ app
- app.pro
- main.cpp
- mainwindow.cpp
- etc...
To copy to clipboard, switch view to plain text mode
The app.pro could reference the libraries:
TEMPLATE = app
TARGET = MyCoolProgram
INCLUDEPATH += ../foo ../bar
LIBS += -L../foo -lfoo
LIBS += -L../bar -lbar
...
TEMPLATE = app
TARGET = MyCoolProgram
INCLUDEPATH += ../foo ../bar
LIBS += -L../foo -lfoo
LIBS += -L../bar -lbar
...
To copy to clipboard, switch view to plain text mode
and a library PRO would look like:
TEMPLATE = lib
TARGET = foo
SOURCES += ...
HEADERS += ...
TEMPLATE = lib
TARGET = foo
SOURCES += ...
HEADERS += ...
To copy to clipboard, switch view to plain text mode
Done from memory, check the qmake manual.
Bookmarks