Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Brainstorm
  4. running qmake on qt project
QtWS25 Last Chance

running qmake on qt project

Scheduled Pinned Locked Moved Unsolved Brainstorm
6 Posts 3 Posters 1.7k Views
  • 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
    merqt
    wrote on last edited by
    #1

    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?

    1 Reply Last reply
    0
    • aha_1980A Offline
      aha_1980A Offline
      aha_1980
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @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

      Qt has to stay free or it will die.

      M 1 Reply Last reply
      1
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        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 ?

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        M 1 Reply Last reply
        1
        • aha_1980A aha_1980

          @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

          M Offline
          M Offline
          merqt
          wrote on last edited by
          #4

          @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

          1 Reply Last reply
          0
          • SGaistS SGaist

            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 ?

            M Offline
            M Offline
            merqt
            wrote on last edited by
            #5

            @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

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              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.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              1

              • Login

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