cli-parser (#4)
All checks were successful
Build ptprnt / build (push) Successful in 1m22s

Goal of this PR should be to integrate a working CLI parser so that commands can be sent to the Printer class to print text, such as
ptprnt -t=FooBar
also, standard flags for setting the output verbosity and help should be implemented

Reviewed-on: #4
This commit is contained in:
2023-10-22 19:42:59 +00:00
parent 7d0cb89bda
commit 9a1aee6658
11 changed files with 197 additions and 53 deletions

View File

@@ -8,6 +8,13 @@ usb_dep = dependency('libusb-1.0')
log_dep = dependency('spdlog')
pangocairo_dep = dependency('pangocairo')
# 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
incdir = include_directories('src')
ptprnt_hpps = [
@@ -38,7 +45,7 @@ ptprnt_srcs = [
ptprnt_lib = library('ptprnt',
include_directories: incdir,
install: true,
dependencies: [usb_dep, log_dep, pangocairo_dep],
dependencies: [usb_dep, log_dep, pangocairo_dep, cli11_dep],
sources: [ptprnt_hpps, ptprnt_srcs])
ptprnt_dep = declare_dependency(include_directories: incdir,
@@ -48,13 +55,14 @@ ptprnt_exe = executable(
'ptprnt',
'src/main.cpp',
install: true,
dependencies : [usb_dep, log_dep, ptprnt_dep],
dependencies : [usb_dep, log_dep, cli11_dep, ptprnt_dep],
cpp_args : ['-DPROJ_VERSION="'+meson.project_version()+'"'],
)
### Unit tests
#cmake = import('cmake')
# GTest
gtest_proj = subproject('gtest')
gtest_dep = gtest_proj.get_variable('gtest_main_dep')
if not gtest_dep.found()