From f9b639ed9c37bf18ce39813823d472f1cb8b417b Mon Sep 17 00:00:00 2001 From: Robin Stuart Date: Sun, 22 Nov 2020 20:17:46 +0000 Subject: [PATCH] Move QZint class into frontend binary --- CMakeLists.txt | 2 - backend_qt/CMakeLists.txt | 32 ------ backend_qt/backend_qt.pro | 144 -------------------------- backend_qt/backend_qt_zintdll.pro | 13 --- backend_qt/backend_vc8.pro | 97 ----------------- backend_qt/readme | 9 -- frontend_qt/CMakeLists.txt | 12 +-- frontend_qt/barcodeitem.h | 2 +- frontend_qt/frontend_qt.pro | 11 +- frontend_qt/frontend_qt_zintdll.pro | 119 ++++++++++----------- frontend_qt/frontend_vc8.pro | 14 +-- {backend_qt => frontend_qt}/qzint.cpp | 0 {backend_qt => frontend_qt}/qzint.h | 0 13 files changed, 77 insertions(+), 378 deletions(-) delete mode 100644 backend_qt/CMakeLists.txt delete mode 100644 backend_qt/backend_qt.pro delete mode 100644 backend_qt/backend_qt_zintdll.pro delete mode 100644 backend_qt/backend_vc8.pro delete mode 100644 backend_qt/readme rename {backend_qt => frontend_qt}/qzint.cpp (100%) rename {backend_qt => frontend_qt}/qzint.h (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4e6ccdb1..25c015d4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -120,7 +120,6 @@ if($ENV{CMAKE_PREFIX_PATH} MATCHES "6[.][0-9][.][0-9]") ${Qt6UiTools_INCLUDES} ${CMAKE_CURRENT_BINARY_DIR} ) - add_subdirectory(backend_qt) add_subdirectory(frontend_qt) else() message(STATUS "Could NOT find Qt6") @@ -142,7 +141,6 @@ else() ${Qt5UiTools_INCLUDES} ${CMAKE_CURRENT_BINARY_DIR} ) - add_subdirectory(backend_qt) add_subdirectory(frontend_qt) else() message(STATUS "Could NOT find Qt5") diff --git a/backend_qt/CMakeLists.txt b/backend_qt/CMakeLists.txt deleted file mode 100644 index 03d9566f..00000000 --- a/backend_qt/CMakeLists.txt +++ /dev/null @@ -1,32 +0,0 @@ -# (c) 2008 by BogDan Vatra < bogdan@licentia.eu > -# vim: set ts=4 sw=4 et : - -project(QZint) - -include_directories(BEFORE "${CMAKE_SOURCE_DIR}/backend" ) - -set(QZint_SRCS qzint.cpp) - -if(USE_QT6) - qt6_wrap_cpp(QZint_SRCS qzint.h) -else() - qt5_wrap_cpp(QZint_SRCS qzint.h) -endif() - -add_library(QZint SHARED ${QZint_SRCS}) - -set_target_properties(QZint PROPERTIES SOVERSION "${ZINT_VERSION_MAJOR}.${ZINT_VERSION_MINOR}" - VERSION ${ZINT_VERSION}) - -add_dependencies(QZint zint) - -link_directories( "${CMAKE_BINARY_DIR}/backend" ) - -if(USE_QT6) - target_link_libraries(QZint zint Qt6::Widgets Qt6::Gui) -else() - target_link_libraries(QZint zint Qt5::Widgets Qt5::Gui) -endif() - -install(TARGETS QZint ${INSTALL_TARGETS_DEFAULT_ARGS} ) -install(FILES qzint.h DESTINATION ${INCLUDE_INSTALL_DIR} COMPONENT Devel) diff --git a/backend_qt/backend_qt.pro b/backend_qt/backend_qt.pro deleted file mode 100644 index 3abf60bf..00000000 --- a/backend_qt/backend_qt.pro +++ /dev/null @@ -1,144 +0,0 @@ - -TEMPLATE = lib - - -# My qt is configured for static build: -# http://qt-project.org/wiki/Build_Standalone_Qt_Application_for_Windows -CONFIG += staticlib - -# for dynamic build enable this: -#CONFIG += dll - -macx{ - CONFIG -= dll - CONFIG += lib_bundle -} - -TARGET = QtZint - -INCLUDEPATH += ../backend - -#EDIT THIS !!!! -DEFINES += ZINT_VERSION="\\\"2.9.1.9\\\"" - -!contains(DEFINES, NO_PNG) { - INCLUDEPATH += ../../lpng - INCLUDEPATH += ../../zlib -} - -contains(DEFINES, QR_SYSTEM){ - LIBS += -lqrencode -} - -contains(DEFINES, QR){ - -INCLUDEPATH += qrencode - -HEADERS += qrencode/bitstream.h \ - qrencode/mask.h \ - qrencode/qrencode.h \ - qrencode/qrencode_inner.h \ - qrencode/qrinput.h \ - qrencode/qrspec.h \ - qrencode/rscode.h \ - qrencode/split.h - -SOURCES += qrencode/bitstream.c \ - qrencode/mask.c \ - qrencode/qrencode.c \ - qrencode/qrinput.c \ - qrencode/qrspec.c \ - qrencode/rscode.c \ - qrencode/split.c -} - -HEADERS += ../backend/aztec.h \ - ../backend/bmp.h \ - ../backend/channel_precalcs.h \ - ../backend/code128.h \ - ../backend/code49.h \ - ../backend/common.h \ - ../backend/composite.h \ - ../backend/dmatrix.h \ - ../backend/eci.h \ - ../backend/font.h \ - ../backend/gb18030.h \ - ../backend/gb2312.h \ - ../backend/gridmtx.h \ - ../backend/gs1.h \ - ../backend/hanxin.h \ - ../backend/large.h \ - ../backend/maxicode.h \ - ../backend/output.h \ - ../backend/pcx.h \ - ../backend/pdf417.h \ - ../backend/reedsol.h \ - ../backend/rss.h \ - ../backend/sjis.h \ - ../backend/stdint_msvc.h \ - ../backend/zint.h \ - qzint.h - -SOURCES += ../backend/2of5.c \ - ../backend/auspost.c \ - ../backend/aztec.c \ - ../backend/bmp.c \ - ../backend/codablock.c \ - ../backend/code.c \ - ../backend/code128.c \ - ../backend/code16k.c \ - ../backend/code49.c \ - ../backend/common.c \ - ../backend/composite.c \ - ../backend/dmatrix.c \ - ../backend/dotcode.c \ - ../backend/eci.c \ - ../backend/emf.c \ - ../backend/gb18030.c \ - ../backend/gb2312.c \ - ../backend/general_field.c \ - ../backend/gif.c \ - ../backend/gridmtx.c \ - ../backend/gs1.c \ - ../backend/hanxin.c \ - ../backend/imail.c \ - ../backend/large.c \ - ../backend/library.c \ - ../backend/mailmark.c \ - ../backend/maxicode.c \ - ../backend/medical.c \ - ../backend/output.c \ - ../backend/pcx.c \ - ../backend/pdf417.c \ - ../backend/plessey.c \ - ../backend/postal.c \ - ../backend/ps.c \ - ../backend/raster.c \ - ../backend/reedsol.c \ - ../backend/rss.c \ - ../backend/sjis.c \ - ../backend/svg.c \ - ../backend/telepen.c \ - ../backend/tif.c \ - ../backend/ultra.c \ - ../backend/upcean.c \ - ../backend/vector.c \ - ../backend/qr.c \ - ../backend/dllversion.c \ - ../backend/code1.c \ - ../backend/png.c \ - qzint.cpp - -VERSION = 2.9.1.9 - -#DESTDIR = . - -#include.path = $$[ZINT_INSTALL_HEADERS] -include.path = inst/include -include.files = ../backend/zint.h qzint.h - -#target.path = $$[ZINT_INSTALL_LIBS] -target.path = inst/lib - -INSTALLS += target include - diff --git a/backend_qt/backend_qt_zintdll.pro b/backend_qt/backend_qt_zintdll.pro deleted file mode 100644 index 8f506df4..00000000 --- a/backend_qt/backend_qt_zintdll.pro +++ /dev/null @@ -1,13 +0,0 @@ -TEMPLATE = lib - -CONFIG += staticlib - -TARGET = QtZintDLL - -INCLUDEPATH += ../backend - -LIBS += -L"../win32/Release" -lzint - -HEADERS += qzint.h - -SOURCES += qzint.cpp diff --git a/backend_qt/backend_vc8.pro b/backend_qt/backend_vc8.pro deleted file mode 100644 index 360ca518..00000000 --- a/backend_qt/backend_vc8.pro +++ /dev/null @@ -1,97 +0,0 @@ -win32 { - TEMPLATE = vclib - CONFIG += staticlib debug-and-release -} - -TARGET = QtZint2 -VERSION = 2.9.1.9 - -QMAKE_CFLAGS += /TP /wd4018 /wd4244 /wd4305 -QMAKE_CXXFLAGS += /TP /wd4018 /wd4244 /wd4305 - -INCLUDEPATH += ../backend d:\\opt\\include - -DEFINES += _CRT_SECURE_NO_WARNINGS _CRT_NONSTDC_NO_WARNINGS ZINT_VERSION=\\\"$$VERSION\\\" include="" - -!contains(DEFINES, NO_PNG) { - SOURCES += ../backend/png.c -} - -HEADERS += ../backend/aztec.h \ - ../backend/bmp.h \ - ../backend/channel_precalcs.h \ - ../backend/code1.h \ - ../backend/code128.h \ - ../backend/code49.h \ - ../backend/common.h \ - ../backend/composite.h \ - ../backend/dmatrix.h \ - ../backend/eci.h \ - ../backend/emf.h \ - ../backend/font.h \ - ../backend/gb18030.h \ - ../backend/gb2312.h \ - ../backend/general_field.h \ - ../backend/gridmtx.h \ - ../backend/gs1.h \ - ../backend/hanxin.h \ - ../backend/large.h \ - ../backend/maxicode.h \ - ../backend/ms_stdint.h \ - ../backend/output.h \ - ../backend/pcx.h \ - ../backend/pdf417.h \ - ../backend/qr.h \ - ../backend/reedsol.h \ - ../backend/rss.h \ - ../backend/sjis.h \ - ../backend/tif.h \ - ../backend/zint.h \ - qzint.h - -SOURCES += ../backend/2of5.c \ - ../backend/auspost.c \ - ../backend/aztec.c \ - ../backend/bmp.c \ - ../backend/codablock.c \ - ../backend/code.c \ - ../backend/code1.c \ - ../backend/code128.c \ - ../backend/code16k.c \ - ../backend/code49.c \ - ../backend/common.c \ - ../backend/composite.c \ - ../backend/dmatrix.c \ - ../backend/dotcode.c \ - ../backend/eci.c \ - ../backend/emf.c \ - ../backend/gb18030.c \ - ../backend/gb2312.c \ - ../backend/gridmtx.c \ - ../backend/general_field.c \ - ../backend/gif.c \ - ../backend/gs1.c \ - ../backend/hanxin.c \ - ../backend/imail.c \ - ../backend/large.c \ - ../backend/library.c \ - ../backend/mailmark.c \ - ../backend/maxicode.c \ - ../backend/medical.c \ - ../backend/output.c \ - ../backend/pcx.c \ - ../backend/pdf417.c \ - ../backend/plessey.c \ - ../backend/postal.c \ - ../backend/ps.c \ - ../backend/qr.c \ - ../backend/raster.c \ - ../backend/reedsol.c \ - ../backend/rss.c \ - ../backend/svg.c \ - ../backend/telepen.c \ - ../backend/tif.c \ - ../backend/ultra.c \ - ../backend/upcean.c \ - ../backend/vector.c \ - qzint.cpp diff --git a/backend_qt/readme b/backend_qt/readme deleted file mode 100644 index 2ec3a7db..00000000 --- a/backend_qt/readme +++ /dev/null @@ -1,9 +0,0 @@ -Edit zint-1.6.pro and edit the 'DEFINES' section - NO_PNG -> compile zint without png support - NO_QR -> compile zint without QR support - QR_SYSTEM -> if you have QT installed in your system, zint will be compiled with QT support - QR -> compile zint with QR support static (you must have qrencode in the current folder) - -Edit compile_n_config and set the paths. - -Exec compile_n_config diff --git a/frontend_qt/CMakeLists.txt b/frontend_qt/CMakeLists.txt index 0b8781f4..2b5ae9d5 100644 --- a/frontend_qt/CMakeLists.txt +++ b/frontend_qt/CMakeLists.txt @@ -3,16 +3,16 @@ project(zint-qt) -include_directories(BEFORE "${CMAKE_SOURCE_DIR}/backend" "${CMAKE_SOURCE_DIR}/backend_qt") +include_directories(BEFORE "${CMAKE_SOURCE_DIR}/backend") -set(zint-qt_SRCS barcodeitem.cpp main.cpp mainwindow.cpp datawindow.cpp sequencewindow.cpp exportwindow.cpp) +set(zint-qt_SRCS barcodeitem.cpp main.cpp mainwindow.cpp datawindow.cpp sequencewindow.cpp exportwindow.cpp qzint.cpp) if(USE_QT6) - qt6_wrap_cpp(zint-qt_SRCS mainwindow.h datawindow.h sequencewindow.h exportwindow.h) + qt6_wrap_cpp(zint-qt_SRCS mainwindow.h datawindow.h sequencewindow.h exportwindow.h qzint.h) qt6_wrap_ui(zint-qt_SRCS mainWindow.ui extData.ui extSequence.ui extExport.ui) qt6_add_resources(zint-qt_SRCS resources.qrc) else() - qt5_wrap_cpp(zint-qt_SRCS mainwindow.h datawindow.h sequencewindow.h exportwindow.h) + qt5_wrap_cpp(zint-qt_SRCS mainwindow.h datawindow.h sequencewindow.h exportwindow.h qzint.h) qt5_wrap_ui(zint-qt_SRCS mainWindow.ui extData.ui extSequence.ui extExport.ui) qt5_add_resources(zint-qt_SRCS resources.qrc) endif() @@ -23,9 +23,9 @@ endif() # grpC39.ui grpCodeOne.ui grpHX.ui grpMSICheck.ui grpUPCA.ui add_executable(zint-qt ${zint-qt_SRCS}) -add_dependencies(zint-qt QZint zint) +add_dependencies(zint-qt zint) -link_directories( "${CMAKE_BINARY_DIR}/backend" "${CMAKE_BINARY_DIR}/backend_qt" ) +link_directories( "${CMAKE_BINARY_DIR}/backend" ) if(USE_QT6) target_link_libraries(zint-qt zint QZint Qt6::UiTools ${QT_QTXML_LIBRARY} Qt6::Gui Qt6::Core) diff --git a/frontend_qt/barcodeitem.h b/frontend_qt/barcodeitem.h index 13b5e78b..0e1ce907 100644 --- a/frontend_qt/barcodeitem.h +++ b/frontend_qt/barcodeitem.h @@ -18,7 +18,7 @@ #define BARCODEITEM_H #include -#include +#include "qzint.h" /** @author BogDan Vatra diff --git a/frontend_qt/frontend_qt.pro b/frontend_qt/frontend_qt.pro index 9b58dbb3..c1ec8a28 100644 --- a/frontend_qt/frontend_qt.pro +++ b/frontend_qt/frontend_qt.pro @@ -12,7 +12,8 @@ HEADERS += barcodeitem.h \ datawindow.h \ exportwindow.h \ mainwindow.h \ - sequencewindow.h + sequencewindow.h \ + qzint.h FORMS += extData.ui \ extExport.ui \ @@ -50,7 +51,8 @@ SOURCES += barcodeitem.cpp \ exportwindow.cpp \ main.cpp \ mainwindow.cpp \ - sequencewindow.cpp + sequencewindow.cpp \ + qzint.cpp TRANSLATIONS = frontend_de.ts @@ -63,10 +65,9 @@ CONFIG += static CONFIG += warn_on thread qt -INCLUDEPATH += ../backend_qt ../backend +INCLUDEPATH += ../backend -LIBS += -lQtZint -lQt5Core -QMAKE_LIBDIR += ../backend_qt/release +LIBS += -lQt5Core !contains(DEFINES, NO_PNG) { # Win diff --git a/frontend_qt/frontend_qt_zintdll.pro b/frontend_qt/frontend_qt_zintdll.pro index a39e6ecd..3e3e5442 100644 --- a/frontend_qt/frontend_qt_zintdll.pro +++ b/frontend_qt/frontend_qt_zintdll.pro @@ -1,59 +1,60 @@ -TEMPLATE = app -TARGET = qtZint -QT += uitools -QT += widgets - -# Input -HEADERS += barcodeitem.h \ - datawindow.h \ - exportwindow.h \ - mainwindow.h \ - sequencewindow.h - -FORMS += extData.ui \ - extExport.ui \ - extSequence.ui \ - grpAztec.ui \ - grpC11.ui \ - grpC128.ui \ - grpC16k.ui \ - grpC39.ui \ - grpC49.ui \ - grpChannel.ui \ - grpCodabar.ui \ - grpCodablockF.ui \ - grpCodeOne.ui \ - grpDBExtend.ui \ - grpDM.ui \ - grpDotCode.ui \ - grpGrid.ui \ - grpHX.ui \ - grpLOGMARS.ui \ - grpMaxicode.ui \ - grpMicroPDF.ui \ - grpMQR.ui \ - grpMSICheck.ui \ - grpPDF417.ui \ - grpQR.ui \ - grpRMQR.ui \ - grpUPCA.ui \ - grpUPCEAN.ui \ - grpVIN.ui \ - mainWindow.ui - -SOURCES += barcodeitem.cpp \ - datawindow.cpp \ - exportwindow.cpp \ - main.cpp \ - mainwindow.cpp \ - sequencewindow.cpp - -RESOURCES += resources.qrc - -RC_FILE += res/qtZint.rc - -INCLUDEPATH += ../backend_qt ../backend - -LIBS += -lQtZintDLL -lzint -QMAKE_LIBDIR += ../backend_qt/release -QMAKE_LIBDIR += ../win32/Release +TEMPLATE = app +TARGET = qtZint +QT += uitools +QT += widgets + +# Input +HEADERS += barcodeitem.h \ + datawindow.h \ + exportwindow.h \ + mainwindow.h \ + sequencewindow.h \ + qzint.h + +FORMS += extData.ui \ + extExport.ui \ + extSequence.ui \ + grpAztec.ui \ + grpC11.ui \ + grpC128.ui \ + grpC16k.ui \ + grpC39.ui \ + grpC49.ui \ + grpChannel.ui \ + grpCodabar.ui \ + grpCodablockF.ui \ + grpCodeOne.ui \ + grpDBExtend.ui \ + grpDM.ui \ + grpDotCode.ui \ + grpGrid.ui \ + grpHX.ui \ + grpLOGMARS.ui \ + grpMaxicode.ui \ + grpMicroPDF.ui \ + grpMQR.ui \ + grpMSICheck.ui \ + grpPDF417.ui \ + grpQR.ui \ + grpRMQR.ui \ + grpUPCA.ui \ + grpUPCEAN.ui \ + grpVIN.ui \ + mainWindow.ui + +SOURCES += barcodeitem.cpp \ + datawindow.cpp \ + exportwindow.cpp \ + main.cpp \ + mainwindow.cpp \ + sequencewindow.cpp \ + qzint.cpp + +RESOURCES += resources.qrc + +RC_FILE += res/qtZint.rc + +INCLUDEPATH += ../backend + +LIBS += -lzint +QMAKE_LIBDIR += ../win32/Release diff --git a/frontend_qt/frontend_vc8.pro b/frontend_qt/frontend_vc8.pro index 77d8c447..8eeab07a 100644 --- a/frontend_qt/frontend_vc8.pro +++ b/frontend_qt/frontend_vc8.pro @@ -14,7 +14,8 @@ HEADERS = mainwindow.h \ barcodeitem.h \ datawindow.h \ exportwindow.h \ - sequencewindow.h + sequencewindow.h \ + qzint.h SOURCES = main.cpp \ mainwindow.cpp \ @@ -22,18 +23,11 @@ SOURCES = main.cpp \ datawindow.cpp \ exportwindow.cpp \ sequencewindow.cpp + qzint.cpp RESOURCES = resources.qrc -INCLUDEPATH += ../backend_qt4 ../backend - -CONFIG(debug, debug|release) { -LIBPATH += ../backend_qt4/debug -} - -CONFIG(release, debug|release) { -LIBPATH += ../backend_qt4/release -} +INCLUDEPATH += ../backend RC_FILE = ./res/qtZint.rc diff --git a/backend_qt/qzint.cpp b/frontend_qt/qzint.cpp similarity index 100% rename from backend_qt/qzint.cpp rename to frontend_qt/qzint.cpp diff --git a/backend_qt/qzint.h b/frontend_qt/qzint.h similarity index 100% rename from backend_qt/qzint.h rename to frontend_qt/qzint.h