I would like to clean compile another different source and install its libraries, before qmake executes its own execution to build the main target. The following link explains it very well, but the problem I have is that I want to generate multiple header files and library, and I want that build to block qmake operation. It seems to me that using neither approach blocks main qmake execution.
PRE_TARGETDEPS fails when using parallel builds
Approach 1 (main-app.pro):
...
extralib.target = extra
extralib.commands = cd $$ANOTHER_PROJECT_DIR; \
make clean && make && make install; \
extralib.depends = FORCE
QMAKE_EXTRA_TARGETS += extralib
PRE_TARGETDEPS = extra
Approach 2 (main-app.pro):
...
TO_GENERATE = $$HOME/myapi/include/a.h $$HOME/myapi/include/b.h
custom_generator.output = $$HOME/myapi/include/a.h $$HOME/myapi/include/b.h
custom_generator.commands = cd $$ANOTHER_PROJECT_DIR; \
make clean && make && make install;
custom_generator.depends = FORCE
custom_generator.input = TO_GENERATE
custom_generator.variable_out = SOURCES
QMAKE_EXTRA_COMPILERS += custom_generator
Prior to everything else, I would like qmake to go into $$ANOTHER_PROJECT_DIR
, do make clean && make && make install
, creating $$HOME/myapi/lib
and $$HOME/myapi/include
, which are required for my main build. Keep in mind that I can't use SUBDIRS since library uses GNU Make, and my main build uses QMake.
Currently what happens is library build commands are started, and instantly QMake decides to proceed with the main build, not waiting for library to completely finish building and installing.
Any suggestions are very much appreciated.