Change the run environment Path from .pro files
-
Hello,
On one of my project on Windows, I need to update the run environment in QtCreator (screen) for two reasons:
- Add path of one of my lib
- Move up the path of another MinGW than the one provided with Qt
But I need to do these changes manually for all unit test project! Is it possible to do it from the .pro files?
And because of these changes, the switch between release and debug dependencies is not automatic anymore.1/- Add a path
Let's suppose that we have an application C using lib B, with lib B using lib A:C -> B -> A
In C.pro file, we'll have:
win32 { CONFIG(release, debug|release) { LIBS += -L$$OUT_PWD/../B/release -lB } else { LIBS += -L$$OUT_PWD/../B/debug -lB } }
At compile time we don't need to link A, but at runtime, we'll have to add it to the Runtime environment
Path
.
Is it possible to add a runtime path from the .pro file, likeQMAKE_RPATHDIR
seems to do on Linux?
Is it ok to use-L
just to add a runtime path or is there a specific qmake variable for this?win32 { CONFIG(release, debug|release) { LIBS += -L$$OUT_PWD/../B/release -lB -L$$OUT_PWD/../A/release } else { LIBS += -L$$OUT_PWD/../B/debug -lB -L$$OUT_PWD/../A/debug } }
2/- Change path order
I'm using a more recent MinGW that the one provided by Qt 6.2. And I need to move it up for each unit test:
Is it possible to configure it from .pro files and commit this change?
Thanks a lot!