diff --git a/.qmake.cache.in b/.qmake.cache.in new file mode 100644 index 0000000..008a232 --- /dev/null +++ b/.qmake.cache.in @@ -0,0 +1,2 @@ +TOP_SRC_DIR=$$PWD +TOP_BUILD_DIR=$$OUT_PWD diff --git a/.qmake.conf b/.qmake.conf new file mode 100644 index 0000000..5b5aab0 --- /dev/null +++ b/.qmake.conf @@ -0,0 +1,2 @@ +TOP_SRC_DIR=$$PWD +TOP_BUILD_DIR=$$shadowed($$PWD) \ No newline at end of file diff --git a/common.pri b/common.pri index 739441b..1a6792e 100644 --- a/common.pri +++ b/common.pri @@ -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 diff --git a/initvars.pro b/initvars.pro new file mode 100644 index 0000000..b3dc9a9 --- /dev/null +++ b/initvars.pro @@ -0,0 +1,3 @@ +TEMPLATE=subdirs +SUBDIRS= # don't build anything, we're just generating the .qmake.cache file +QMAKE_SUBSTITUTES += .qmake.cache.in diff --git a/limereport.pro b/limereport.pro index 84179ac..2fc1bb0 100644 --- a/limereport.pro +++ b/limereport.pro @@ -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