diff --git a/meson.build b/meson.build new file mode 100644 index 0000000..0f06586 --- /dev/null +++ b/meson.build @@ -0,0 +1,33 @@ +project('kima2', 'cpp', default_options : ['cpp_std=c++20'], version : '1.8.0') + +conf_data = configuration_data() +conf_data.set('PROJECT_VERSION', '"' + meson.project_version() + '"') +configure_file(output : 'config.h', + configuration : conf_data) +configuration_inc = include_directories('.') + +#csv = cmake.subproject('csv-parser') +#csv_lib = csv.dependency('csv') + +nlohmann_lib = dependency('nlohmann_json', version : '>=3.5.0', required : false) + +if not nlohmann_lib.found() + nlohmann_inc = include_directories('subprojects/nlohmann_json/single_include') + nlohmann_lib = declare_dependency(include_directories : nlohmann_inc) +endif + +csv_inc = include_directories('subprojects/csv-parser/single_include') +csv_dep = declare_dependency(include_directories : csv_inc) + +singleapp_proj = subproject('singleapplication') +singleapp_lib = singleapp_proj.get_variable('singleapp_lib') +singleapp_dep = singleapp_proj.get_variable('singleapp_dep') + +subdir('src') + +if build_machine.system() == 'linux' + install_data('misc/kima2.svg', install_dir : get_option('datadir') / 'icons/hicolor/scalable/apps') + install_data('misc/kima2.desktop', install_dir : get_option('datadir') / 'applications') + install_data('manual/Benutzerhandbuch.pdf', install_dir : get_option('datadir') / 'kima2') +endif + diff --git a/src/core/meson.build b/src/core/meson.build new file mode 100644 index 0000000..b54f484 --- /dev/null +++ b/src/core/meson.build @@ -0,0 +1,13 @@ +boost = dependency('boost', modules: ['date_time'], static: true) +xlnt = dependency('xlnt') +sqlite = dependency('sqlite3') + +src = ['database.cpp', 'entity.cpp', 'entityint.cpp', 'entityuuid.cpp', + 'seller.cpp', 'article.cpp', 'sale.cpp', 'marketplace.cpp', + 'excelreader.cpp', 'csvreader.cpp', 'jsonutil.cpp', 'utils.cpp'] + +core_inc = include_directories('..') + +core_lib = static_library('core', src, dependencies: [boost, xlnt, sqlite, nlohmann_lib, csv_dep]) + +core_dep = declare_dependency(link_with: core_lib, include_directories : core_inc) diff --git a/src/gui/meson.build b/src/gui/meson.build new file mode 100644 index 0000000..18bfcee --- /dev/null +++ b/src/gui/meson.build @@ -0,0 +1,23 @@ +qt5 = import('qt5') +qt5_dep = dependency('qt5', modules: ['Core', 'Gui', 'PrintSupport', 'Network']) + +thread_dep = dependency('threads') + + +src = ['kima2.cpp', 'mainwindow.cpp', 'sellerdialog.cpp', 'sellermodel.cpp', + 'pricedialog.cpp', 'basketmodel.cpp', 'salemodel.cpp', 'reportdialog.cpp', + 'reportmodel.cpp', 'settingsdialog.cpp'] + +ui = ['mainwindow.ui', 'sellerdialog.ui', 'pricedialog.ui', 'reportdialog.ui', 'settingsdialog.ui'] + +processed = qt5.preprocess(moc_headers : ['basketmodel.h', 'mainwindow.h', 'pricedialog.h', + 'reportdialog.h', 'sellerdialog.h', 'settingsdialog.h', + 'sellermodel.h', 'salemodel.h'], + ui_files : ui, + qresources : '../../kima2.qrc', + dependencies: qt5_dep) + +kima2 = executable('kima2', sources : [src, processed], + dependencies : [qt5_dep, singleapp_dep, core_dep, printer_dep, thread_dep], + include_directories : [configuration_inc], + install : true) diff --git a/src/meson.build b/src/meson.build new file mode 100644 index 0000000..439c81e --- /dev/null +++ b/src/meson.build @@ -0,0 +1,3 @@ +subdir('core') +subdir('printer') +subdir('gui') diff --git a/src/printer/meson.build b/src/printer/meson.build new file mode 100644 index 0000000..64f0602 --- /dev/null +++ b/src/printer/meson.build @@ -0,0 +1,9 @@ +libusb = dependency('libusb-1.0') + +src = ['posprinter.cpp', 'utils.cpp'] + +printer_inc = include_directories('..') + +printer_lib = static_library('printer', src, dependencies: [libusb, core_dep]) + +printer_dep = declare_dependency(link_with : printer_lib, include_directories : printer_inc) diff --git a/src/printer/posprinter.cpp b/src/printer/posprinter.cpp index 61926fc..8a06f63 100644 --- a/src/printer/posprinter.cpp +++ b/src/printer/posprinter.cpp @@ -19,8 +19,6 @@ const std::string PosPrinter::Command::RIGHT_ALIGN = {0x1b, 0x61, 0x02}; const std::string PosPrinter::Command::FONT_SIZE_BIG = {0x1b, 0x21, 0x10}; const std::string PosPrinter::Command::FONT_SIZE_NORMAL = {0x1b, 0x21, 0x00}; const std::string PosPrinter::Command::FEED = {0x1b, 0x64, 0x03}; -const std::string PosPrinter::Command::PARTIAL_CUT = {0x1b, 0x69}; -const std::string PosPrinter::Command::FULL_CUT = {0x1b, 0x6d}; PosPrinter::PosPrinter() : PosPrinter(PrinterDevice()) {} diff --git a/src/printer/posprinter.h b/src/printer/posprinter.h index 1cdbff6..4ddd083 100644 --- a/src/printer/posprinter.h +++ b/src/printer/posprinter.h @@ -49,8 +49,6 @@ class PosPrinter static const std::string FONT_SIZE_BIG; static const std::string FONT_SIZE_NORMAL; static const std::string FEED; - static const std::string PARTIAL_CUT; - static const std::string FULL_CUT; }; private: