qmake shadow build problem using QMAKE_EXTRA_COMPILERS
-
QMake version 3.1
Qt version 5.9.7 (also tried in 5.15.2)I created a simple project that demonstrates the problem I am having with performing a shadow build and using QMAKE_EXTRA_COMPILERS.
This is the layout of my files based from /tmp/test:
├── shadow │ └── Makefile └── src ├── gen.pro ├── main.cpp ├── test1.xrt ├── test2.xrt └── test3.xrt
TEMPLATE = app TARGET = gen INCLUDEPATH += . SOURCES += main.cpp target.path = /tmp/data INSTALLS += target # XRT_FILES = test1.xrt test2.xrt test3.xrt gen_headers.input = XRT_FILES gen_headers.output = ${QMAKE_FILE_BASE}.h gen_headers.commands = $(COPY) ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT} gen_headers.variable_out = MY_HEADERS.files gen_headers.CONFIG += no_link QMAKE_EXTRA_COMPILERS += gen_headers MY_HEADERS.path = $$target.path MY_HEADERS.CONFIG += no_check_exist INSTALLS += MY_HEADERS
when I execute "qmake ../src" from the shadow directory the generated Makefile has these install commands for MY_HEADERS:
install_MY_HEADERS: first FORCE @test -d $(INSTALL_ROOT)/tmp/data || mkdir -p $(INSTALL_ROOT)/tmp/data -$(QINSTALL) /tmp/test/src/test1.h $(INSTALL_ROOT)/tmp/data/test1.h -$(QINSTALL) /tmp/test/src/test2.h $(INSTALL_ROOT)/tmp/data/test2.h -$(QINSTALL) /tmp/test/src/test3.h $(INSTALL_ROOT)/tmp/data/test3.h
The '/tmp/test/src' path seems to be based on the .pro file and not based on my shadow directory location. How do I force that path to be in '/tmp/test/shadow' instead? Is this a bug in qmake?
I tried 'gen_headers.output = $$OUT_PWD/${QMAKE_FILE_BASE}.h' but that did not change anything.