0

How can i change building directory in qt project file? I tried this:

TARGET = project
win32: {
    CONFIG(release, debug|release): DLLDESTDIR +=  $$PWD/../lib
}
unix: {
    CONFIG(release, debug|release): QMAKE_POST_LINK += $$quote(cp project $$PWD/../lib)
}

But this didn't give result :(

Found something a bit similar: DESTDIR parameter. However, this option is only responsible for executables. And how to transfer all the files?

garbart
  • 465
  • 4
  • 19

2 Answers2

1

While QtCreator has one single setting for the generated output, in order to achieve the same with qmake you have to specify some more variables, look at the ones ending in DIR specified in the qmake variables overview.

I you can get a good overview from these answers as well.

UPDATE: never tried this but give $$OUT_PWD a try as mentioned in the first blogpost.

UPDATE2: never mind, the docs state Note: Do not attempt to overwrite the value of this variable.

BNT
  • 936
  • 10
  • 27
0

Thanks to @BNT for the help.

CONFIG(debug, debug|release) {
  DESTDIR = $$PWD/../debug/lib
} else {
  DESTDIR = $$PWD/../lib
}

OBJECTS_DIR = $${DESTDIR}/.obj
MOC_DIR = $${DESTDIR}/.moc
RCC_DIR = $${DESTDIR}/.rcc
UI_DIR = $${DESTDIR}/.ui

Where DESTDIR is the folder for the executable.

But the Makefile in such a way not to move. It has a dedicated constant, and in the documentation, as @BNT already noticed, it is written:

Note: Do not attempt to overwrite the value of this variable.

garbart
  • 465
  • 4
  • 19