A common solution is to build the application using the libraries and headers files found within the source directory. If you want that your application can be built using both (system-wide and local) just add a conditional to your .pro file.
@
// toplevel.pro
SUBDIRS += lib app
CONFIG += ordered // make sure lib is built before app
// app.pro
exists(/usr/include/yourproject.h) { // system-wide includes installed
INCLUDEPATH += /usr/include
LIBS += -L/usr/lib
}
else {
INCLUDEPATH += ../include
LIBS += -L../lib
}
@
Brain to terminal. Not tested.
make install then copies the includes and libraries to their system-wide places, so that other applications can use it as well.
A more sophisticated solution would be using "qmake features":http://doc.qt.nokia.com/latest/qmake-advanced-usage.html#adding-new-configuration-features as for example "QCA":http://delta.affinix.com/qca/ does.