diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..e69de29 diff --git a/README.md b/README.md new file mode 100644 index 0000000..07297a7 --- /dev/null +++ b/README.md @@ -0,0 +1,51 @@ +# ptprnt + +This is a rewrite of [ptouch-print](https://git.familie-radermacher.ch/linux/ptouch-print.git) as a toy project for my personal amusement. The currently available solutions are good enough for generating labels, but i wanted to explore libusb and maybe improve the functionality of my label printer. All credits for reverse engineering the USB commands to Dominic Rademacher. + +## Dependencies +This project requires: +- spdlog +- libusb +- pango +- cairo +- meson +- gtest (optional, for testing, will be installed by meson) +- gcov (optional, for coverage reports) + +## Build + +Clone the repository and simply let meson do the heavy lifting. + +```bash +meson setup builddir +``` +If you want to generate coverage reports, enable them via the command line switch +```bash +meson setup builddir -Db_coverage=true +``` + +Rebuild by simply invoking ninja +```bash +ninja -C builddir +``` + +## Run +Run the binary from your builddir +```bash +builddir/ptprnt +``` + +## Test +Testing is done via gtest. To run your test simply invoke ninja with the "test" target. +```bash +ninja -C builddir test +``` + +Coverage reports can be generated via gcov if you enabled them (see Build section) by building the `coverage-text` target. + +## License + +GPLv3, see [LICENSE](./LICENSE) + +## Author +Moritz Martinius diff --git a/meson.build b/meson.build index 939045b..2323591 100644 --- a/meson.build +++ b/meson.build @@ -1,7 +1,7 @@ project('ptprnt', 'cpp', - version: 'v0.1.0-'+run_command('git', 'rev-parse', '--short', 'HEAD').stdout().strip(), + 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'] + default_options : ['c_std=c11', 'cpp_std=c++17'] ) usb_dep = dependency('libusb-1.0') @@ -44,12 +44,12 @@ ptprnt_lib = library('ptprnt', ptprnt_dep = declare_dependency(include_directories: incdir, link_with: ptprnt_lib) -ptprnt_debug_exe = executable( +ptprnt_exe = executable( 'ptprnt', 'src/main.cpp', install: true, dependencies : [usb_dep, log_dep, ptprnt_dep], - cpp_args : ['-DPROJ_VERSION="'+meson.project_version()+'"'] + cpp_args : ['-DPROJ_VERSION="'+meson.project_version()+'"'], )