I looked at some projects generated by the Qt plugin for VS and noticed that they use the environment variable QTDIR to refer for example to the Qt header files. However I failed to figure out where this variable is set. I guess it must be somewhere in the project settings, however I could not find it. Also please note that I am referring to the environment variables required during the build, not the ones for debugging.
On Windows there are two ways to set an environment variable like QTDIR: either permanently in System Properties->Advanced->Environment Variables
or temporarily for a single cmd session by opening cmd.exe
and executing set QTDIR=/path/to/qt
; now when starting VS from that commandline (execute devenv.exe
) it will use the QTDIR value just set. The second case you use mainly when you have multiple QT installations.
Apart from that, you can also use User Macros in VS Property sheets. From the build tools' point of view they are sort of equivalent to environment variables. Add a new property sheet to your project, double click on the new sheet, go to the User Macros
page and click on Add Macro
. Nice thing is you can share this property sheet amongst all your Qt projects.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With