Skip to content

Commit

Permalink
no_zint & static_build flags has been added
Browse files Browse the repository at this point in the history
  • Loading branch information
fralx committed Jun 16, 2017
2 parents 7f45100 + 4e19142 commit 60c45b8
Show file tree
Hide file tree
Showing 10 changed files with 63 additions and 25 deletions.
13 changes: 10 additions & 3 deletions 3rdparty/zint-2.4.4/backend_qt4/Zint.pro
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
DEFINES += NO_PNG

TEMPLATE = lib
CONFIG += dll

contains(CONFIG, static_build){
CONFIG += staticlib
DEFINES += HAVE_STATIC_BUILD
}

!contains(CONFIG, staticlib){
CONFIG += dll
DEFINES += QZINT_LIBRARY
}

include(../../../common.pri)

Expand All @@ -18,7 +26,6 @@ unix{

INCLUDEPATH += $$PWD/../backend
DEFINES += _CRT_SECURE_NO_WARNINGS _CRT_NONSTDC_NO_WARNINGS ZINT_VERSION=\\\"$$VERSION\\\"
DEFINES += QZINT_LIBRARY
TARGET = QtZint

!contains(DEFINES, NO_PNG) {
Expand Down
4 changes: 4 additions & 0 deletions 3rdparty/zint-2.4.4/backend_qt4/qzint_global.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@

#include <QtCore/qglobal.h>

#ifdef HAVE_STATIC_BUILD
# define QZINTSHARED_EXPORT /**/
#else
#if defined(QZINT_LIBRARY)
# define QZINTSHARED_EXPORT Q_DECL_EXPORT
#else
# define QZINTSHARED_EXPORT Q_DECL_IMPORT
#endif
#endif

#endif // QZINT_GLOBAL_H
7 changes: 5 additions & 2 deletions common.pri
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
CONFIG += build_translations
CONFIG += zint

!contains(CONFIG, no_zint){
CONFIG += zint
}

ZINT_PATH = $$PWD/3rdparty/zint-2.4.4
contains(CONFIG,zint){
Expand Down Expand Up @@ -59,7 +62,7 @@ RCC_DIR = $${ARCH_DIR}/$${BUILD_TYPE}/rcc

LIMEREPORT_VERSION_MAJOR = 1
LIMEREPORT_VERSION_MINOR = 4
LIMEREPORT_VERSION_RELEASE = 17
LIMEREPORT_VERSION_RELEASE = 18

LIMEREPORT_VERSION = '\\"$${LIMEREPORT_VERSION_MAJOR}.$${LIMEREPORT_VERSION_MINOR}.$${LIMEREPORT_VERSION_RELEASE}\\"'
DEFINES += LIMEREPORT_VERSION_STR=\"$${LIMEREPORT_VERSION}\"
Expand Down
12 changes: 8 additions & 4 deletions demo_r1/demo_r1.pro
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ macx{

unix:{
LIBS += -L$${DEST_LIBS} -llimereport
contains(CONFIG,zint){
LIBS += -L$${DEST_LIBS} -lQtZint
!contains(CONFIG, static_build){
contains(CONFIG,zint){
LIBS += -L$${DEST_LIBS} -lQtZint
}
}
DESTDIR = $$DEST_DIR
# QMAKE_POST_LINK += mkdir -p $$quote($$REPORTS_DIR) |
Expand All @@ -53,8 +55,10 @@ win32 {
RC_FILE += mainicon.rc

QMAKE_POST_LINK += $$QMAKE_COPY_DIR $$quote($$EXTRA_DIR\\*) $$quote($$REPORTS_DIR\\demo_reports) $$escape_expand(\\n\\t)
contains(CONFIG,zint){
LIBS += -L$${DEST_LIBS} -lQtZint
!contains(CONFIG, static_build){
contains(CONFIG,zint){
LIBS += -L$${DEST_LIBS} -lQtZint
}
}
LIBS += -L$${DEST_LIBS} -llimereport
}
Expand Down
13 changes: 8 additions & 5 deletions demo_r2/demo_r2.pro
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ macx{

unix:{
LIBS += -L$${DEST_LIBS} -llimereport
contains(CONFIG,zint){
LIBS += -L$${DEST_LIBS} -lQtZint
!contains(CONFIG, static_build){
contains(CONFIG,zint){
LIBS += -L$${DEST_LIBS} -lQtZint
}
}
DESTDIR = $$DEST_DIR
QMAKE_POST_LINK += $$QMAKE_COPY_DIR $$quote($$EXTRA_DIR) $$quote($$REPORTS_DIR) $$escape_expand(\n\t)
Expand All @@ -50,9 +52,10 @@ win32 {

DESTDIR = $$DEST_DIR
RC_FILE += mainicon.rc

contains(CONFIG,zint){
LIBS += -L$${DEST_LIBS} -lQtZint
!contains(CONFIG, static_build){
contains(CONFIG,zint){
LIBS += -L$${DEST_LIBS} -lQtZint
}
}
LIBS += -L$${DEST_LIBS} -llimereport

Expand Down
13 changes: 8 additions & 5 deletions designer/designer.pro
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ macx{

unix:{
LIBS += -L$${DEST_LIBS} -llimereport
contains(CONFIG,zint){
LIBS += -L$${DEST_LIBS} -lQtZint
!contains(CONFIG, static_build){
contains(CONFIG,zint){
LIBS += -L$${DEST_LIBS} -lQtZint
}
}
DESTDIR = $$DEST_DIR
linux{
Expand All @@ -40,9 +42,10 @@ win32 {

DESTDIR = $$DEST_DIR
RC_FILE += mainicon.rc

contains(CONFIG,zint){
LIBS += -L$${DEST_LIBS} -lQtZint
!contains(CONFIG, static_build){
contains(CONFIG,zint){
LIBS += -L$${DEST_LIBS} -lQtZint
}
}
LIBS += -L$${DEST_LIBS} -llimereport
}
Expand Down
6 changes: 6 additions & 0 deletions limereport.pro
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
TEMPLATE = subdirs

!contains(CONFIG, no_zint){
CONFIG += zint
}

include(common.pri)
contains(CONFIG, zint){
SUBDIRS += 3rdparty
}

export($$CONFIG)
SUBDIRS += \
limereport

Expand Down
12 changes: 9 additions & 3 deletions limereport/limereport.pro
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
TARGET = limereport
TEMPLATE = lib

CONFIG += lib
CONFIG += dll
#CONFIG += staticlib
contains(CONFIG, static_build){
CONFIG += staticlib
}

!contains(CONFIG, staticlib){
CONFIG += lib
CONFIG += dll
}

CONFIG += create_prl
CONFIG += link_prl

Expand Down
4 changes: 3 additions & 1 deletion limereport/lrfactoryinitializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
#include "serializators/lrxmlqrectserializator.h"
#include "serializators/lrxmlserializatorsfactory.h"

inline void initResources(){
void initResources(){
Q_INIT_RESOURCE(report);
Q_INIT_RESOURCE(lobjectinspector);
Q_INIT_RESOURCE(lrdatabrowser);
Expand Down Expand Up @@ -95,9 +95,11 @@ BaseDesignIntf * createTextItem(QObject* owner, LimeReport::BaseDesignIntf* par
return new LimeReport::TextItem(owner,parent);
}

#ifdef HAVE_ZINT
BaseDesignIntf * createBarcodeItem(QObject* owner, LimeReport::BaseDesignIntf* parent){
return new BarcodeItem(owner,parent);
}
#endif

BaseDesignIntf* createHLayout(QObject *owner, LimeReport::BaseDesignIntf *parent)
{
Expand Down
4 changes: 2 additions & 2 deletions limereport/lrscriptenginemanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -551,9 +551,9 @@ QString ScriptEngineManager::expandScripts(QString context, QVariant& varValue,
if (reportItem){
QScriptValue svThis = se->globalObject().property("THIS");
if (svThis.isValid()){
se->newQObject(svThis, this);
se->newQObject(svThis, reportItem);
} else {
svThis = se->newQObject(this);
svThis = se->newQObject(reportItem);
se->globalObject().setProperty("THIS",svThis);
}
}
Expand Down

0 comments on commit 60c45b8

Please sign in to comment.