QMake: How do I change a compiler option which is already given a value by the framework
-
There is also the "-after" flag: "link":http://qt-project.org/doc/qt-4.8/qmake-running.html#makefile-mode-options.
-
Thank you for all the suggestions :-) - unfortunately none of them seems to do the trick. Except possibly the option of including mkspec in the repo. Can I tell Qt to look in an alternative place (the repo) for the mkspec?
-
Yes, qmake -spec accepts absolute paths. I have not tried relative ones, but it's worth a try.
-
Ok, this would be a workable solution. Thanks. Still a bit frustrating that there is no way to simply override the option.
-
@
QMAKE_CXXFLAGS -= -mmacosx-version-min=10.5
QMAKE_CXXFLAGS += -mmacosx-version-min=10.6
@ -
doesn't work
-
What Qt version are you using?
@cat test.pro
message($$QMAKE_CXXFLAGS)
QMAKE_CXXFLAGS -= -mmacosx-version-min=10.6
message($$QMAKE_CXXFLAGS)qmake -spec macx-g++
Project MESSAGE: -pipe -mmacosx-version-min=10.6
Project MESSAGE: -pipe
@ -
I'm using qt 4.8.3. If I run your test.pro I get:
Project MESSAGE: -pipe
Project MESSAGE: -pipeThe reason seems to be that the flags are added after the pro file is processed. (Which is also why manipulating QMAKE_CXXFLAGS doesn't work.)
It is interesting that you have a different (and much more desireable) behaviour. What Qt version are you running?
-
I'm using Qt 5. Unfortunately I have no access to a Mac right now to test.
In a next step you could <code>qmake -d</code> to see where the flag actually comes from; it should have been already set when processing the <code>.pro</code> file (and thus beeing removable).
-
Ok, qmake -d shows that tge macx-g++ spec sets it to QMAKE_CXXFLAGS_X86_64. Changing this variable in the pro file actually works. I cannot get rid of the -mmacosx-version-min=10.5 from the spec, but now my setting -mmacosx-version-min=10.6 appears last and gets effect.
Thanks.
-
The proper way should is to overwrite the QMAKE_MACOSX_DEPLOYMENT_TARGET flags, for example:
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.7
and then it will change the mmacosx-version-min to 10.7