Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. "make arguments" via qmake?
Forum Updated to NodeBB v4.3 + New Features

"make arguments" via qmake?

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
12 Posts 5 Posters 11.2k Views 2 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.
  • A Offline
    A Offline
    Asperamanca
    wrote on 12 Nov 2012, 08:32 last edited by SGaist 2 Jan 2024, 20:11
    #1

    I'm trying to set a make argument via the .pro file. From the qmake reference, I believed it should be QMAKE_CXXFLAGS, but the value I add there never appears in the "make arguments" field in Qt Creator.

    Which qmake variable do I have to use?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      sierdzio
      Moderators
      wrote on 12 Nov 2012, 08:41 last edited by
      #2

      Make arguments in Qt Creator (Projects pane) are independent from ones set in qmake .pro file. qmake does not invoke make, by the way, it only generates the Makefile.

      (Z(:^

      1 Reply Last reply
      1
      • A Offline
        A Offline
        Asperamanca
        wrote on 12 Nov 2012, 08:45 last edited by
        #3

        So if Qt Creator loads a .pro file (and assuming no .pro.user file exists), it simply ignores my settings?

        I am aware that qmake does not invoke the make itself.
        But basically, all I need is for my flag to appear in the makefile.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          sierdzio
          Moderators
          wrote on 12 Nov 2012, 08:49 last edited by
          #4

          Tobias would have to fill in the details. You can definitely use CXXFLAGS to add compiler flags to Makefile. I don't know about adding other flags. You can get all available vars from "the reference":http://doc.qt.digia.com/qt/qmake-variable-reference.html.

          MAKEFILE var is nice to look at - it allows to change the name of the makefile, so that you can use your own "main" file with standard name.

          (Z(:^

          1 Reply Last reply
          0
          • A Offline
            A Offline
            Asperamanca
            wrote on 12 Nov 2012, 10:00 last edited by
            #5

            QMAKE_CXXFLAGS is only a part of what I need.

            I need to be able to define make arguments, basically append to the environment variable MAKEFLAGS.
            How would I do that with qmake commands?

            1 Reply Last reply
            0
            • S Offline
              S Offline
              sierdzio
              Moderators
              wrote on 12 Nov 2012, 10:03 last edited by
              #6

              DEFINES is a good start. As hinted above, I don't know how to do it cleanly. You can use the MAKEFILE variable trick (create your own Makefile with flags set, tell qmake to generate something like temp_makefile, link both files and voila) - it's nasty, but should work.

              (Z(:^

              1 Reply Last reply
              0
              • A Offline
                A Offline
                Asperamanca
                wrote on 12 Nov 2012, 10:12 last edited by
                #7

                The way I understand it, DEFINES is something different than an environment variable, and the make won't see it. Also, there does not seem to be a flag in qmake at all to pass on "makeflags", so the second best option would be for me to define an environment variable.

                All I have that I give the compile server is the .pro file, so the environment variable would need to be set by qmake based on some function or variable within my .pro file.

                1 Reply Last reply
                0
                • A Offline
                  A Offline
                  Asperamanca
                  wrote on 12 Nov 2012, 11:33 last edited by
                  #8

                  Found a way to pass the option as a command line argument. Solved for me. Thanks!

                  1 Reply Last reply
                  0
                  • S Offline
                    S Offline
                    swoz
                    wrote on 4 Feb 2014, 14:07 last edited by
                    #9

                    How?

                    1 Reply Last reply
                    0
                    • A Offline
                      A Offline
                      Asperamanca
                      wrote on 12 Feb 2014, 09:47 last edited by
                      #10

                      Unfortunately, I don't remember and even after a lengthy search did not find what my original problem was. Sorry!

                      I have since learned to post my own solutions to my own threads.

                      K 1 Reply Last reply 20 Aug 2015, 18:26
                      0
                      • A Asperamanca
                        12 Feb 2014, 09:47

                        Unfortunately, I don't remember and even after a lengthy search did not find what my original problem was. Sorry!

                        I have since learned to post my own solutions to my own threads.

                        K Offline
                        K Offline
                        kumararajas
                        wrote on 20 Aug 2015, 18:26 last edited by
                        #11

                        @Asperamanca Can you please tell me how did you pass a variable to qmake?

                        Thanks,
                        Kumara

                        --Kumar

                        1 Reply Last reply
                        0
                        • T Offline
                          T Offline
                          top-master
                          wrote on 1 Feb 2024, 10:47 last edited by
                          #12

                          If you set the environment variable MAKEFLAGS, the Make program will pass it to any sub-make call.

                          But nmake does no such thing, hence QMake redirects MAKEFLAGS to each of sub-nmakes, like:

                          @set MAKEFLAGS=$(MAKEFLAGS)
                          $(MAKE)
                          

                          Also, the XD framework's QMake supports SUBMAKE_FLAGS, which just appends to command line (without changing MAKEFLAGS environement-variable).

                          1 Reply Last reply
                          0
                          • SGaistS SGaist marked this topic as a question on 1 Feb 2024, 20:11
                          • SGaistS SGaist has marked this topic as solved on 1 Feb 2024, 20:11

                          • Login

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