I have a QT project (c++) that has a library that needs to be built before the app starts because of dependencies. My qmake file does the following:
TEMPLATE = MyApp
QMAKE_EXTRA_TARGETS += MyDependency
MyDependency.depends = FORCE
MyDependency.commands = make -C dependencies/MyDependency/
PRE_TARGETDEPS += MyDependency
DEPENDPATH += . \
dependencies/MyDependency/
dependencies/MyDependency/utilities
INCLUDEPATH += . \
dependencies/MyDependency/
dependencies/MyDependency/utilities
LIBS += -Ldependencies/MyDependency/dist
LIBS += -lmessageclient \
-lmessages \
-lssutilities \
-lboost_serialization \
-lcommon \
-lmng \
-lz \
-lrt \
-ldl
My project is very large and I am using distcc to take advantage of distributed compiling. However whenever I run make with multiple distcc nodes, my project begins compiling MyDependency in addition to my project's code that depends upon MyDependency. This causes compile errors on portions of the code that require the dependency be built beforehand.
If I run qmake and then a subsequent make with only 1 distcc node it will compile MyDependency first and then continue with compiling the rest of the project. I have also gotten this to work in other projects by using
CONFIG += ordered
TEMPLATE = subdirs
However I would prefer to keep the structure the same without having multiple subdirectories and .pro files. Is there a way to accomplish this while still using multiple distcc nodes?