72 lines
2.0 KiB
Meson
72 lines
2.0 KiB
Meson
project('ptprnt', 'cpp',
|
|
version: 'v0.1.0-'+run_command('git', 'rev-parse', '--short', 'HEAD', check: true).stdout().strip(),
|
|
license: 'GPLv3',
|
|
default_options : ['c_std=c11', 'cpp_std=c++17']
|
|
)
|
|
|
|
usb_dep = dependency('libusb-1.0')
|
|
log_dep = dependency('spdlog')
|
|
pangocairo_dep = dependency('pangocairo')
|
|
|
|
incdir = include_directories('src')
|
|
|
|
ptprnt_hpps = [
|
|
'src/libusbwrap/interface/IUsbDeviceFactory.hpp',
|
|
'src/libusbwrap/interface/IUsbDevice.hpp',
|
|
'src/libusbwrap/UsbDeviceFactory.hpp',
|
|
'src/libusbwrap/LibUsbTypes.hpp',
|
|
'src/libusbwrap/UsbDevice.hpp',
|
|
'src/interface/IPrinterDriver.hpp',
|
|
'src/interface/IPrinterTypes.hpp',
|
|
'src/P700Printer.hpp',
|
|
'src/PtouchPrint.hpp',
|
|
'src/graphics/Bitmap.hpp',
|
|
'src/graphics/Image.hpp',
|
|
'src/graphics/Monochrome.hpp'
|
|
]
|
|
|
|
ptprnt_srcs = [
|
|
'src/PtouchPrint.cpp',
|
|
'src/P700Printer.cpp',
|
|
'src/graphics/Image.cpp',
|
|
'src/graphics/Bitmap.cpp',
|
|
'src/graphics/Monochrome.cpp',
|
|
'src/libusbwrap/UsbDeviceFactory.cpp',
|
|
'src/libusbwrap/UsbDevice.cpp',
|
|
]
|
|
|
|
ptprnt_lib = library('ptprnt',
|
|
include_directories: incdir,
|
|
install: true,
|
|
dependencies: [usb_dep, log_dep, pangocairo_dep],
|
|
sources: [ptprnt_hpps, ptprnt_srcs])
|
|
|
|
ptprnt_dep = declare_dependency(include_directories: incdir,
|
|
link_with: ptprnt_lib)
|
|
|
|
# CLI11
|
|
cli11_proj = subproject('cli11')
|
|
cli11_dep = cli11_proj.get_variable('CLI11_dep')
|
|
if not cli11_dep.found()
|
|
error('CLI11 not found, can not proceed')
|
|
endif
|
|
|
|
ptprnt_exe = executable(
|
|
'ptprnt',
|
|
'src/main.cpp',
|
|
install: true,
|
|
dependencies : [usb_dep, log_dep, ptprnt_dep, ],
|
|
cpp_args : ['-DPROJ_VERSION="'+meson.project_version()+'"'],
|
|
)
|
|
|
|
|
|
### Unit tests
|
|
|
|
# GTest
|
|
gtest_proj = subproject('gtest')
|
|
gtest_dep = gtest_proj.get_variable('gtest_main_dep')
|
|
if not gtest_dep.found()
|
|
error('MESON_SKIP_TEST: gtest not installed.')
|
|
endif
|
|
|
|
subdir('tests') |