Conditinal Define for BarCode
Easy-to-use print report library and designer
Brought to you by:
aliks-os
Hey Alik,
It would be a nice feature to have a define on QtRPT.pri that we remove BarCode functionality from QtRPT, to not bother the user that does not want that to have to build Zint.
Like (in QtRPT.pri file):
DEFINES += NO_BARCODE
And all over the code when including headers, or using BarCode.h class you should check for it with compiler directives (when inside C++ code):
#ifdef NO_BARCODE
// BarCode manipulation
#endif
And on CommonFiles_QtRPT.pri you should do something like this:
INCLUDEPATH += $$PWD
!contains(DEFINES,NO_BARCODE) {
INCLUDEPATH += $$PWD/../zint-2.4.4/backend_qt4
INCLUDEPATH += $$PWD/../zint-2.4.4/backend
}
SOURCES += $$PWD/CommonClasses.cpp \
$$PWD/chart.cpp
!contains(DEFINES,NO_BARCODE) {
SOURCES += $$PWD/Barcode.cpp
}
HEADERS += $$PWD/CommonClasses.h \
$$PWD/chart.h
!contains(DEFINES,NO_BARCODE) {
HEADERS += $$PWD/Barcode.h
}
!contains(DEFINES,NO_BARCODE) {
include($$PWD/../QtRPT/config.pri)
LIBS += -L $$DEST_DIRECTORY/lib -lQtZint
}
Sorry in C++ code it should be ifndef:
Added, thank you