running qmake on qt project



  • Hello,

    Whenever i try to run a qt project with qmake i get the error:

    'C:\Program' is not recognized as an internal or external command,
    operable program or batch file.
    'C:\Program' is not recognized as an internal or external command,
    operable program or batch file.
    'C:\Program' is not recognized as an internal or external command,
    operable program or batch file.

    My win32 section looks like this:
    win32 {
    DEFINES +=GIT_BIN=C:\Program Files\Git\bin\git
    DEFINES += GIT_REVISION=C:\Program Files\Git\bin\git rev-parse --short HEAD
    DEFINES += GIT_REVISION_ATOOLS='\"$$system('C:\Program Files\Git\bin\git' rev-parse --short HEAD)\"'
    DEFINES += _USE_MATH_DEFINES
    DEFINES += NOMINMAX
    SIMCONNECT=C:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\WidevieW
    INCLUDEPATH += C:\Program Files\Lockheed Martin\Prepar3D v4 SDK 4.3.29.25520\inc\SimConnect
    LIBS+=C:\Program Files\Lockheed Martin\Prepar3D v4 SDK 4.3.29.25520\lib\SimConnect\SimConnect.lib

    }

    Could anyone help please?


  • Qt Champions 2018

    @merqt

    That's the typical problem with path names containing spaces, as space is a word separator.

    You'll need to quote your path names properly in the .pro file, e.g. SIMCONNECT="C:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\WidevieW"

    It will be a bit more complicated for this one: DEFINES +=GIT_BIN=C:\Program Files\Git\bin\git. I think it should be like this: DEFINES += \\\"GIT_BIN=C:\Program Files\Git\bin\git\\\", but you will have to test.

    Regards


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    You must properly quote all these paths with spaces in them.

    Also, all these calls to git won't be executed the way you think they are. The only one that might have a chance is the one from GIT_REVISION_ATOOLS.

    By the way, what's the use of that define of GIT_BIN ?



  • @aha_1980 :
    Thank you. I tried all these approaches:
    C:\Program Files\Git\bin\git

    " C:\Program Files\Git\bin\git "

    " C:'Program Files'\Git\bin\git "

    " C:\Program Files\Git\bin\git "

    C:/Program Files/Git/bin/git

    " C:/Program Files/Git/bin/git"

    But got the same error



  • @SGaist
    Thank you, despite placing quotes the error recurs
    @SGaist said in running qmake on qt project:

    By the way, what's the use of that define of GIT_BIN ?

    None. I tried to substitute the hard-coded path in GIT_REVISION_ATOOLS with GIT_BIN


  • Lifetime Qt Champion

    In that case, defines won't help. You can put that path in variable to reuse in your different calls.

    In any case, I would recommend to rather generate a header file using QMAKE_SUBSTITUTE like described in this wiki entry. IIRC, this variable is going to get documented in the next Qt release but is already usable since some time now.

    This will simplify your life and avoid having to generate string defines for all the possible shell that you are going to use.


Log in to reply
 

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