There is some error:
TEMPLATE = lib
in MultiFunctester.pri
..pri files are similar to header files, this will be added to every pro file that includes it. This can be misleading, so avoid using the TEMPLATE variable in .pri
- If I understand your first point well, you have copies of
MultiFunctester.pri
in each directory. This is also very confusing, you should only have one (or another pri
file). - Overriding previous settings is not as good as it sounds. When you have to debug information about which configuration is used in each
pro
file, you will feel pain. Rather, declare all common settings in one place, and declare them for setting variables when they apply. - I do not see
MultiFunctester.pri
anywhere ...
You use the subdirs
template if you want each subdirectory to be built separately (they can be interdependent). This is useful, for example, when you have a framework with many executables. look at the qwt source directory
In this case you use
TEMPLATE = subdirs CONFIG += ordered ### They MUST be subdirectories, no ../, and no .pro SUBDIRS += dir1\ dir2\ ... dirn
for each level aside from the last (where you have TEMPLATE = lib or app
).
Now, if you have a directory structure, but you want to put everything together, you can create pri
for each subdirectory in which you include the source files. For instance:
in the main src.pro
file you have
include(MultiFunctester.pri) ## for the configurations include($PATHTOSOLAR/Solar.pri) include($PATHTODMM/dmm.pri) include($PATHTOSAFETY/safety.pri) include($PATHTOSETUP/setup.pri) include($PATHTOSTART/start.pri) include($PATHTOMAIN/main.pri)
where $PATHTO...
is the relative path from the src.pro
directory.
Now in each subdirectory you include the source files.
onesubdir.pri:
headers += /PATHTOTHISSUBDIR/file1.h
source share