Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I specify different working directories in qt creator?

Tags:

qt

qt-creator

I'm using the latest QT SDK under Windows and am wondering how I specify a working directory based on the build type. I need a different working directory and release and debug builds of the same project. For instance, I have a run target called MyProgram and two build targets, Release and Debug. MyProgram depends on some external libraries. When I run MyProgram in debug I need it to run in the directory C:\foo\bar\libraries\debug, however when I run it in release I need it to run in directory C:\foo\bar\libraries\release. It would appear that the Working Directory is only dependent on the run target and not on the build target. Is there a way to specify a Working Directory based on both run and build target? Could I use a variable to specify release/debug in the Working Directory?

like image 539
Jon Avatar asked Nov 13 '22 12:11

Jon


1 Answers

Yes, you can. Delete the .pro.user file in the project directory, open the project, and set "Create build configurations" to manually, and check "Use shadow building". Now you can specify the target directories. BTW, for a better solution for your missing libs, check out the Qt resource system: http://developer.qt.nokia.com/doc/qt-4.8/QResource.html

like image 191
Rijk Avatar answered Dec 18 '22 07:12

Rijk