Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. qmake shadow build problem using QMAKE_EXTRA_COMPILERS
Forum Updated to NodeBB v4.3 + New Features

qmake shadow build problem using QMAKE_EXTRA_COMPILERS

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 162 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mcarter
    wrote on last edited by
    #1

    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
    

    gen.pro:

    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.

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved