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. Building qt project from command line
Forum Updated to NodeBB v4.3 + New Features

Building qt project from command line

Scheduled Pinned Locked Moved General and Desktop
7 Posts 2 Posters 7.7k 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.
  • BlackMambaB Offline
    BlackMambaB Offline
    BlackMamba
    wrote on last edited by
    #1

    Hello,
    I am trying to set up hudson for my qt project for automatic builds.
    I am normally building my project in qt creator with qmake and msvc compiler.
    What would be the equivalent in batch command line?
    I have tried this :
    @qmake myproject.pro
    qmake
    make@

    but I have no idea where to find the make.exe and I am not even sure if this is enough.
    I make.exe part of msvc?
    What do you think?

    1 Reply Last reply
    0
    • Chris KawaC Offline
      Chris KawaC Offline
      Chris Kawa
      Lifetime Qt Champion
      wrote on last edited by
      #2

      make is part of compiler package. In case of MSVC it is called "nmake" and in case of MinGW it's "mingw32-make".

      To have it available make sure you're compiling from the VS command prompt. Either find a shortcut created for you by the VS installer or run <VS Directory>/VC/vcvarsall.bat with a platform parameter (x86 or amd64).
      When you do that add Qt bin directory to the PATH environment variable.

      1 Reply Last reply
      0
      • BlackMambaB Offline
        BlackMambaB Offline
        BlackMamba
        wrote on last edited by
        #3

        Thank you very much Chris!
        Why do I need to compile from the VS command prompt?
        If I just give the nmake path, it won't work?

        1 Reply Last reply
        0
        • Chris KawaC Offline
          Chris KawaC Offline
          Chris Kawa
          Lifetime Qt Champion
          wrote on last edited by
          #4

          No, this .bat file also sets up various environment variables for you eg. PATH, INCLUDE and LIB. Without those the compiler won't be able to find standard includes and libraries to link to.
          Of course you can peek inside that .bat to see what needs to be done and set these all by yourself but it's a lot of typing so what's the point?

          1 Reply Last reply
          0
          • BlackMambaB Offline
            BlackMambaB Offline
            BlackMamba
            wrote on last edited by
            #5

            I see so basically, it should look like this :
            add the qt dir path to %PATH%. Then :
            @qmake myproject.pro
            qmake
            pathtobatfile/vcvarsall.bat (with x86 param)
            @
            ? Or do I still need to do something with nmake?

            1 Reply Last reply
            0
            • Chris KawaC Offline
              Chris KawaC Offline
              Chris Kawa
              Lifetime Qt Champion
              wrote on last edited by
              #6

              You shoud run the bat first. It sets up paths for the compiler and nmake. qmake might need them too.

              1 Reply Last reply
              0
              • BlackMambaB Offline
                BlackMambaB Offline
                BlackMamba
                wrote on last edited by
                #7

                Ok :)
                @
                pathtobatfile/vcvarsall.bat (with x86 param)
                qmake myproject.pro
                qmake
                nmake
                @

                Is that correct?

                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