Create a .pri
file which has your INCLUDEPATH
, etc; and then refer to it in your other projects' .pro
files:
# Common.pri
INCLUDEPATH += ../myPath
INCLUDE += myHeader.h
# OtherProject.pro
!include( ./Common.pri ) {
error( Could not find the Common.pri file. )
}
INCLUDEPATH += ../myOtherPath
Remember to use the +=
operator in your .pro
files otherwise they will overwrite the .pri
file variables.