Move build location from project source top dir to qmake top build dir

This commit is contained in:
frostasm 2018-08-04 18:23:56 +03:00
parent c5a033fe51
commit 384368dd38
5 changed files with 27 additions and 8 deletions

2
.qmake.cache.in Normal file
View File

@ -0,0 +1,2 @@
TOP_SRC_DIR=$$PWD
TOP_BUILD_DIR=$$OUT_PWD

2
.qmake.conf Normal file
View File

@ -0,0 +1,2 @@
TOP_SRC_DIR=$$PWD
TOP_BUILD_DIR=$$shadowed($$PWD)

View File

@ -24,7 +24,12 @@ CONFIG(release, debug|release){
BUILD_TYPE = debug
}
BUILD_DIR = $$PWD/build/$${QT_VERSION}
isEmpty(TOP_BUILD_DIR) {
BUILD_DIR = $${OUT_PWD}/build/$${QT_VERSION}
}else{
BUILD_DIR = $${TOP_BUILD_DIR}/build/$${QT_VERSION}
}
DEST_INCLUDE_DIR = $$PWD/include
unix{
ARCH_DIR = $${OUT_PWD}/unix

3
initvars.pro Normal file
View File

@ -0,0 +1,3 @@
TEMPLATE=subdirs
SUBDIRS= # don't build anything, we're just generating the .qmake.cache file
QMAKE_SUBSTITUTES += .qmake.cache.in

View File

@ -10,12 +10,19 @@ contains(CONFIG, zint){
}
export($$CONFIG)
CONFIG += ordered
SUBDIRS += \
limereport
CONFIG += ordered
SUBDIRS += demo_r1 demo_r2 designer
initvars.pro \
limereport \
demo_r1 \
demo_r2 \
designer
# QMake top level srcdir and builddir
# https://wiki.qt.io/QMake-top-level-srcdir-and-builddir
#Qt4 .qmake.cache.in
#Qt5 .qmake.conf
OTHER_FILES += \
.qmake.conf \
.qmake.cache.in