Can you use environment variables in qt creator?

Therefore, I use a bunch of libraries in the code I'm currently working in. Now I turn them on, doing things like win32:LIBS += "C:/my/location/Tools/libcurl/trunk/lib/Debug/curllib.lib". However, I do have an environment variable that defines %TOOLS%how C:/my/location/Tools/. I tried just changing my include to win32:LIBS += "%TOOLS%libcurl/trunk/lib/Debug/curllib.lib", but it could not find the files. I looked online and it should be doable. I missed something simple, as a way to tell the Qt developer to look at the window's environment variables?

Thank!

+4
source share
2 answers

qmake, :

win32:LIBS += $$(TOOLS)/libcurl/trunk/lib/Debug/curllib.lib

TOOLS , C:/my/location/Tools.

. .pro:

TOOLS="C:/my/location/Tools"

, $$:

win32:LIBS += $$TOOLS/libcurl/trunk/lib/Debug/curllib.lib
+5

:

$$VAR => QMake variable value at the time qmake is run
$${VAR} => QMake variable value at time qmake is run (subtle difference)
$(VAR) => Contents of an Environment variable at the time Makefile (not qmake) is run

: $$ (TOOLS) , .

+1

Source: https://habr.com/ru/post/1544851/


All Articles