8

I'm trying to change the build output directory in QT Creator (i.e. instead of outputting to ./debug, I want to output to ../../bin/debug). I've tried to edit the build output directory via the Projects mode, but it's read only. Looking at the .pro file doesn't seem to have anything obvious for me to edit.

Nick Bolton
  • 38,276
  • 70
  • 174
  • 242
  • 1
    I don't use qmake but perhaps this will be helpful: http://stackoverflow.com/questions/1741877/qt-and-qmake-build-dir – HostileFork says dont trust SE May 31 '10 at 14:18
  • I've been able to do this by setting DESTDIR, but I can't find the per-config way of doing it (i.e. I want a different dir for each of debug and release). – Nick Bolton May 31 '10 at 14:45
  • possible duplicate of [How to specify different Debug/Release output directories in QMake .pro file](http://stackoverflow.com/questions/2580934/how-to-specify-different-debug-release-output-directories-in-qmake-pro-file) – Nick Bolton May 31 '10 at 15:08
  • 1
    Duplicate of: http://stackoverflow.com/questions/2580934/how-to-specify-different-debug-release-output-directories-in-qmake-pro-file – Nick Bolton May 31 '10 at 15:09

2 Answers2

9

I was having a permissions problem and Qt was unable to run the compiled program in my windows partition so I had to change the build path to run in Linux, to do this I edited the {projectName}.pro.user located in the project folder and changed the following variable(s) which may vary depending on you project settings):

<value type="QString" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory">/new/path</value>

this value will belong to one specific target (release or debug) just see where tag belongs to.

Juan Melo
  • 320
  • 3
  • 7
  • Many thanks, I was having hell! First off, finding where the heck the built binaries ended up, second off, figuring out how to change the location (they were getting stuck in an ugly long folder in my $HOME) – hanetzer Aug 05 '14 at 17:22
5

You can also do it directly from inside QtCreator. Go to Projects | Build & Run | Build | General | Build Directory. When you enter a new directory path, the text will turn red - indicating that the directory the as yet unmade output build will be in does not exist yet. When you build the project, however, it will turn black.

CodeLurker
  • 1,248
  • 13
  • 22