qmake: How to set a variable that must contain spaces?
I need to set QMAKE_CXXFLAGS to a value that contains spaces, specifically
QMAKE_CXXFLAGS += /AI"$$(PROGRAMFILES)/Reference Assemblies/Microsoft/Framework/.NETFramework/v4.0"
The PROGRAMFILES environment variable will (usually) resolve to a path with spaces. How can I handle that?
Forgot to mention I'm still sitting on 4.8...
In that case, did you try with just quote ?
Without the possibility to test, I think you have to escape the quotes with enough escape chars ('') so the quotes actually get to the shell. You may need two or three pairs of '' to get it work - just test until it works :)
QMAKE_CXXFLAGS += /AI"\\"$$(PROGRAMFILES)/Reference Assemblies/Microsoft/Framework/.NETFramework/v4.0\\""
Edit: seems my escape chars were lost, I meant backslashes
That put me on the right track. The solution is:
QMAKE_CXXFLAGS += /AI\"$$(PROGRAMFILES)/Reference Assemblies/Microsoft/Framework/.NETFramework/v4.0\"
@Asperamanca Cool! Thanks for reporting back.
Please mark this thread as solved now.