"make arguments" via qmake?
-
wrote on 12 Nov 2012, 08:32 last edited by SGaist 2 Jan 2024, 20:11
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?
-
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.
-
wrote on 12 Nov 2012, 08:45 last edited by
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. -
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.
-
wrote on 12 Nov 2012, 10:00 last edited by
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? -
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.
-
wrote on 12 Nov 2012, 10:12 last edited by
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.
-
wrote on 12 Nov 2012, 11:33 last edited by
Found a way to pass the option as a command line argument. Solved for me. Thanks!
-
wrote on 4 Feb 2014, 14:07 last edited by
How?
-
wrote on 12 Feb 2014, 09:47 last edited by
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.
-
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.
wrote on 20 Aug 2015, 18:26 last edited by@Asperamanca Can you please tell me how did you pass a variable to qmake?
Thanks,
Kumara -
wrote on 1 Feb 2024, 10:47 last edited by
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 changingMAKEFLAGS
environement-variable). -
S SGaist marked this topic as a question on 1 Feb 2024, 20:11
-
S SGaist has marked this topic as solved on 1 Feb 2024, 20:11