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/.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 diff --git a/common.pri b/common.pri index c439321..8c9354c 100644 --- a/common.pri +++ b/common.pri @@ -1,4 +1,6 @@ -CONFIG *= build_translations +!contains(CONFIG, no_build_translations){ + CONFIG += build_translations +} #CONFIG *= easy_profiler !contains(CONFIG, no_zint){ @@ -67,7 +69,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 3ede347..74c1524 100644 --- a/limereport.pro +++ b/limereport.pro @@ -11,12 +11,13 @@ contains(CONFIG, zint){ export($$CONFIG) - -SUBDIRS += limereport - CONFIG += ordered - -SUBDIRS += demo_r1 demo_r2 designer +SUBDIRS += \ + initvars.pro \ + limereport \ + demo_r1 \ + demo_r2 \ + designer !contains(CONFIG, embedded_designer){ !contains(CONFIG, static_build){ @@ -24,5 +25,10 @@ SUBDIRS += designer_plugin } } - - +# 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 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 0b4e5cd..dcb088b 100644 --- a/limereport/limereport.pro +++ b/limereport/limereport.pro @@ -33,7 +33,6 @@ contains(CONFIG, staticlib){ } EXTRA_FILES += \ - $$PWD/lrglobal.cpp \ $$PWD/lrglobal.h \ $$PWD/lrdatasourcemanagerintf.h \ $$PWD/lrreportengine.h \ @@ -87,6 +86,19 @@ 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) contains(CONFIG,build_translations){