From 384368dd38be166d268c751f556399df74993e73 Mon Sep 17 00:00:00 2001 From: frostasm Date: Sat, 4 Aug 2018 18:23:56 +0300 Subject: [PATCH 1/4] Move build location from project source top dir to qmake top build dir --- .qmake.cache.in | 2 ++ .qmake.conf | 2 ++ common.pri | 7 ++++++- initvars.pro | 3 +++ limereport.pro | 21 ++++++++++++++------- 5 files changed, 27 insertions(+), 8 deletions(-) create mode 100644 .qmake.cache.in create mode 100644 .qmake.conf create mode 100644 initvars.pro 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 From 169c8bbf9c45c2b41bf89d6c3b3c5ab9d4e73bf5 Mon Sep 17 00:00:00 2001 From: frostasm Date: Sat, 4 Aug 2018 19:03:48 +0300 Subject: [PATCH 2/4] Install binary and header files to Qt installation dir --- limereport/limereport.prf | 22 ++++++++++++++++++++++ limereport/limereport.pro | 15 ++++++++++++++- 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 limereport/limereport.prf diff --git a/limereport/limereport.prf b/limereport/limereport.prf new file mode 100644 index 0000000..98acf6c --- /dev/null +++ b/limereport/limereport.prf @@ -0,0 +1,22 @@ +QT += xml sql script + +greaterThan(QT_MAJOR_VERSION, 4) { +QT += widgets printsupport +} + +INCLUDEPATH += $$[QT_INSTALL_HEADERS]/LimeReport + +CONFIG(debug, debug|release) { +LIB_NAME = limereportd +} else { +LIB_NAME = limereport +} + +greaterThan(QT_MAJOR_VERSION, 4) { + LIBS += -l$${LIB_NAME} +} else { + qtAddLibrary($${LIB_NAME}) +} + +DEFINES += LIMEREPORT +DEFINES -= NO_LIMEREPORT diff --git a/limereport/limereport.pro b/limereport/limereport.pro index b05ac00..dff9004 100644 --- a/limereport/limereport.pro +++ b/limereport/limereport.pro @@ -37,7 +37,6 @@ contains(CONFIG, staticlib){ } EXTRA_FILES += \ - $$PWD/lrglobal.cpp \ $$PWD/lrglobal.h \ $$PWD/lrdatasourcemanagerintf.h \ $$PWD/lrreportengine.h \ @@ -92,6 +91,20 @@ contains(CONFIG,zint){ } + +#### Install mkspecs, headers and libs to QT_INSTALL_DIR + +headerFiles.path = $$[QT_INSTALL_HEADERS]/LimeReport/ +headerFiles.files = $${DEST_INCLUDE_DIR}/* +INSTALLS += headerFiles + +mkspecs.path = $$[QT_INSTALL_DATA]/mkspecs/features +mkspecs.files = limereport.prf +INSTALLS += mkspecs + +target.path = $$[QT_INSTALL_LIBS] +INSTALLS += target + ####### ####Automatically build required translation files (*.qm) From 715c241a37eb60a33aead8ddd10f1416b2be70e6 Mon Sep 17 00:00:00 2001 From: frostasm Date: Sat, 4 Aug 2018 19:22:43 +0300 Subject: [PATCH 3/4] Add no_build_translations config parameter --- common.pri | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/common.pri b/common.pri index 1a6792e..cc2fc8e 100644 --- a/common.pri +++ b/common.pri @@ -1,4 +1,7 @@ -CONFIG += build_translations + +!contains(CONFIG, no_build_translations){ + CONFIG += build_translations +} !contains(CONFIG, no_zint){ CONFIG += zint From 7ae5347e64085aba3fd08d4307584e254822c7c7 Mon Sep 17 00:00:00 2001 From: frostasm Date: Sun, 5 Aug 2018 17:15:11 +0300 Subject: [PATCH 4/4] fix build with Travis CI --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index dadebf9..39dedbc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,7 +18,7 @@ install: script: - - qmake -r + - qmake -r limereport.pro - make - make check