Browse Source

meson is now working ... somehow

master
Martin Brodbeck 2 years ago
parent
commit
d13f9d2824
  1. 19
      meson.build
  2. 3
      src/core/csvreader.cpp
  3. 6
      src/core/meson.build
  4. 2
      src/gui/mainwindow.cpp
  5. 12
      src/gui/meson.build
  6. 2
      src/gui/settingsdialog.h
  7. 2
      src/meson.build
  8. 8
      src/printer/meson.build

19
meson.build

@ -1,3 +1,20 @@
project('kima2', 'cpp')
project('kima2', 'cpp', default_options : ['cpp_std=c++17'], version : '1.6.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('.')
cmake = import('cmake')
#csv = cmake.subproject('csv-parser')
#csv_lib = csv.dependency('csv')
nlohmann = cmake.subproject('nlohmann_json', cmake_options : ['-DJSON_BuildTests=OFF', '-DCMAKE_BUILD_TYPE=Release'])
nlohmann_lib = nlohmann.dependency('nlohmann_json')
singleapp_proj = subproject('singleapplication')
singleapp_lib = singleapp_proj.get_variable('singleapp_lib')
singleapp_dep = singleapp_proj.get_variable('singleapp_dep')
subdir('src')

3
src/core/csvreader.cpp

@ -2,7 +2,8 @@
#include "utils.h"
#include <fstream>
#include <csv.hpp>
#include "../../subprojects/csv-parser/single_include/csv.hpp"
//#include <csv.hpp>
namespace fs = std::filesystem;

6
src/core/meson.build

@ -6,4 +6,8 @@ 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_lib = static_library('core', src, dependencies :[boost, xlnt, sqlite])
core_inc = include_directories('..')
core_lib = static_library('core', src, dependencies :[boost, xlnt, sqlite, nlohmann_lib])
core_dep = declare_dependency(link_with : core_lib, include_directories : core_inc)

2
src/gui/mainwindow.cpp

@ -1,7 +1,7 @@
#include "mainwindow.h"
#include "basketmodel.h"
#include "config.h"
#include <config.h>
#include "pricedialog.h"
#include "reportdialog.h"
#include "salemodel.h"

12
src/gui/meson.build

@ -1,5 +1,8 @@
qt5 = import('qt5')
qt5_dep = dependency('qt5', modules: ['Core', 'Gui', 'PrintSupport'])
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',
@ -7,9 +10,12 @@ src = ['kima2.cpp', 'mainwindow.cpp', 'sellerdialog.cpp', 'sellermodel.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'],
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)
kima2 = executable('kima2', sources : [src, processed], dependencies : [qt5_dep, singleapp_dep, core_dep, printer_dep, thread_dep],
include_directories : [configuration_inc])

2
src/gui/settingsdialog.h

@ -9,6 +9,8 @@
class SettingsDialog : public QDialog
{
Q_OBJECT
public:
SettingsDialog(QWidget* parent = nullptr,
Qt::WindowFlags f = Qt::WindowTitleHint | Qt::WindowSystemMenuHint);

2
src/meson.build

@ -1,5 +1,3 @@
printer = dependency('printer_dep', fallback : ['printer', 'printer_dep'])
subdir('core')
subdir('printer')
subdir('gui')

8
src/printer/meson.build

@ -1,5 +1,9 @@
libusb = dependency('libusb-1.0')
src = ['posprinter.cpp']
src = ['posprinter.cpp', 'utils.cpp']
printer_lib = static_library('printer', src, dependencies: [libusb])
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)

Loading…
Cancel
Save