Qmake QMAKE_SUBSTITUTES behaviour with PWD for out-of-source-builds



  • Hi,

    I am using the guide to make global variables in subdirs projects from "here":http://qt-project.org/wiki/QMake-top-level-srcdir-and-builddir.

    This is working but I need to run qmake about 3 times after each other for out-of-source-builds to get the project to build correctly.

    I have done some searching and came to the following strange behaviour using the *.in file (not sure it what I am doing is even supported). The following code is inside my .qmake.cache.in file:
    @
    message(-- PWD IS: $$PWD)
    message(-- OUT_PWD IS: $$OUT_PWD)

    TOP_DIR=$$PWD
    message(TOP_DIR: $$TOP_DIR)
    TOP_OUT_DIR=$$OUT_PWD
    message(TOP_OUT_DIR: $$TOP_OUT_DIR)--
    @

    When I run qmake for the first time on the project I get the following output (through Qt Creator):
    @
    Project MESSAGE: -- PWD IS: Z:/Path/To/My/Project
    Project MESSAGE: -- OUT_PWD IS: Z:/Path/To/My/Shadow/build-Qt_4_8_1_mingw-Debug/.
    Project MESSAGE: TOP_DIR:
    Project MESSAGE: TOP_OUT_DIR:
    @

    Why is my local variables empty but the message reports that the original variables is correct?

    After about the 3rd time that I run qmake on the project the output is:
    @
    Project MESSAGE: -- PWD IS: Z:/Path/To/My/Project
    Project MESSAGE: -- OUT_PWD IS: Z:/Path/To/My/Shadow/build-Qt_4_8_1_mingw-Debug/.
    Project MESSAGE: TOP_DIR: Z:/Path/To/My/Project
    Project MESSAGE: TOP_OUT_DIR: Z:/Path/To/My/Shadow/build-Qt_4_8_1_mingw-Debug/.
    @

    Could this be a bug in Qt 4.8.1?

    PS:
    In "this":http://qt-project.org/forums/viewthread/21145 post Lukas Geyer did say the following:

    [quote author="Lukas Geyer" date="1350393883"]
    Interestingly enough $$PWD did not work for me in the qmake.cache.in (was empty), but $$PRO_FILE_PWD did.
    [/quote]
    but that is about all that I could find on the subject, no actual solution for OUT_PWD


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.