So I use a bunch of libraries in the code I'm currently working in. Right now I include them by doing things like win32:LIBS += "C:/my/location/Tools/libcurl/trunk/lib/Debug/curllib.lib"
. However, I have an environmental variable that defined %TOOLS%
as C:/my/location/Tools/
. I tried to simply change my include to win32:LIBS += "%TOOLS%libcurl/trunk/lib/Debug/curllib.lib"
, but it could not find the files. I looked online and this should be doable. Am I missing something simple, like a way to tell Qt creator to look at window's environmental variables?
Thanks!
To get the content of an environment variable when qmake is processed, you can use the following :
win32:LIBS += $$(TOOLS)/libcurl/trunk/lib/Debug/curllib.lib
TOOLS
should be an environment variable set to C:/my/location/Tools
.
But you don't necessarily need an environment variable for this. You can simple define a variable in your .pro file :
TOOLS="C:/my/location/Tools"
And use it's value by prefixing it with $$
:
win32:LIBS += $$TOOLS/libcurl/trunk/lib/Debug/curllib.lib
Try the following:
$$VAR => QMake variable's value at the time qmake is run
$${VAR} => QMake variable's value at time qmake is run (subtle difference)
$(VAR) => Contents of an Environment variable at the time Makefile (not qmake) is run
In your Case: $$(TOOLS) return the Path you need.
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