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.4k 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.
  • sierdzioS Offline
    sierdzioS Offline
    sierdzio
    Moderators
    wrote on 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 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
      • sierdzioS Offline
        sierdzioS Offline
        sierdzio
        Moderators
        wrote on 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 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
          • sierdzioS Offline
            sierdzioS Offline
            sierdzio
            Moderators
            wrote on 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 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 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 last edited by
                  #9

                  How?

                  1 Reply Last reply
                  0
                  • A Offline
                    A Offline
                    Asperamanca
                    wrote on 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
                    0
                    • A Asperamanca

                      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 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 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
                        • SGaistS SGaist has marked this topic as solved on

                        • Login

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