2

I am using Qt 5.5.1. I want to configure shadow build (on/off) via the .pro itself since there is an overhead of clicking the shadow build checkbox for each project. Please help me out if you have any solution for the same. I tried various ways to change build directory path from .pro file.But it is not working out. This is my .pro file:

OUT_PWD=$PRO_FILE_PWD
PWD=$PRO_FILE_PWD
INCLUDEPATH += $PWD
DEPENDPATH += $PWD
message($OUT_PWD)
message($PWD)
#QMAKE_MAKEFILE = /home/test/MST15_SSD_MSTK_SAS/Code/MSTK3.0_2015
#QMAKE_DISTCLEAN = /home/test/MST15_SSD_MSTK_SAS/Code//MSTK3.0_2015/
CLEAN_DEPS = $PRO_FILE_PWD
message($CLEAN_DEPS)

BASEPATH = $PRO_FILE_PWD
Makefile =$PRO_FILE_PWD
message($Makefile)
QMAKE_CLEAN = $PWD
message($QMAKE_CLEAN)

CONFIG(debug, debug|release) {
BUILDDIR = ${BASEPATH}/debug
DLLDESTDIR = ${BASEPATH}/debug
DESTDIR = ${BASEPATH}/debug

message($DESTDIR_TARGET)
} else {
BUILDDIR = ${BASEPATH}/release
DESTDIR = ${BASEPATH}/release
}

OBJECTS_DIR = ${BUILDDIR}
#PRECOMPILED_HEADER = $PRO_FILE_PWD/debug
MOC_DIR = ${BUILDDIR}
RCC_DIR = ${BUILDDIR}
UI_DIR = ${BUILDDIR}
QMAKE_POST_LINK += cp $PRO_FILE_PWD/rpe.xml ${BUILDDIR}
QMAKE_POST_LINK += cp $PRO_FILE_PWD/rpeSim.xml ${BUILDDIR}
QMAKE_POST_LINK += mv Makefile* ${BUILDDIR}
QMAKE_POST_LINK += mv object_script* ${BUILDDIR}
QMAKE_CXXFLAGS += -Wall

win* {
message (Building for windows target in $BUILD_DIR)
QMAKE_CXXFLAGS += -std=gnu++11
}
linux* {
message (Building for linux target in $BUILD_DIR)
#QMAKE_CXXFLAGS += -std=gnu++11
}

I want to get rid of shadow build by changing build directory path from .pro file or any other way using .pro file.Please help me out.

user3305763
  • 59
  • 10
  • You seem to have defined the variables according to the principles in http://stackoverflow.com/questions/2580934/how-to-specify-different-debug-release-output-directories-in-qmake-pro-file. what happens? – user2672165 Dec 30 '15 at 10:52
  • When I clean it. It uses some other directory for clean. The other sub- directories in the project use the PWD. Since default build directory is not the project directory(because of shadow build enabled) , it is generating some build error. So before building I have to untick shadow build checkbox. Is there any code for .pro which can change default build directory path while building. – user3305763 Dec 30 '15 at 11:08
  • According to this topic, you can't do so: https://forum.qt.io/topic/39703/how-to-turn-shadow-build-off-in-the-pro-file – jpo38 Dec 30 '15 at 17:02

0 Answers0