meson.build 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. project('megapixels', 'c')
  2. gnome = import('gnome')
  3. gtkdep = dependency('gtk+-3.0')
  4. tiff = dependency('libtiff-4')
  5. zbar = dependency('zbar')
  6. threads = dependency('threads')
  7. cc = meson.get_compiler('c')
  8. libm = cc.find_library('m', required: false)
  9. resources = gnome.compile_resources('megapixels-resources', 'org.postmarketos.Megapixels.gresource.xml')
  10. conf = configuration_data()
  11. conf.set_quoted('DATADIR', join_paths(get_option('prefix'), get_option('datadir')))
  12. conf.set_quoted('SYSCONFDIR', get_option('sysconfdir'))
  13. configure_file(
  14. output: 'config.h',
  15. configuration: conf )
  16. # Define DEBUG for debug builds only (debugoptimized is not included on this one)
  17. if get_option('buildtype') == 'debug'
  18. add_global_arguments('-DDEBUG', language: 'c')
  19. endif
  20. # Workaround for libtiff having ABI changes but not changing the internal version number
  21. if get_option('tiffcfapattern')
  22. add_global_arguments('-DLIBTIFF_CFA_PATTERN', language: 'c')
  23. endif
  24. executable('megapixels',
  25. 'main.c',
  26. 'ini.c',
  27. 'quickpreview.c',
  28. 'camera.c',
  29. 'device.c',
  30. 'pipeline.c',
  31. 'camera_config.c',
  32. 'io_pipeline.c',
  33. 'process_pipeline.c',
  34. 'zbar_pipeline.c',
  35. 'matrix.c',
  36. resources,
  37. dependencies : [gtkdep, libm, tiff, zbar, threads],
  38. install : true)
  39. install_data(['data/org.postmarketos.Megapixels.desktop'],
  40. install_dir : get_option('datadir') / 'applications')
  41. install_data(['data/org.postmarketos.Megapixels.metainfo.xml'],
  42. install_dir : get_option('datadir') / 'metainfo')
  43. install_data('data/org.postmarketos.Megapixels.svg',
  44. install_dir: join_paths(get_option('datadir'), 'icons/hicolor/scalable/apps')
  45. )
  46. install_data([
  47. 'config/pine64,pinephone-1.0.ini',
  48. 'config/pine64,pinephone-1.1.ini',
  49. 'config/pine64,pinephone-1.2.ini',
  50. 'config/pine64,pinetab.ini',
  51. ],
  52. install_dir : get_option('datadir') / 'megapixels/config/')
  53. install_data(['postprocess.sh'],
  54. install_dir : get_option('datadir') / 'megapixels/',
  55. install_mode: 'rwxr-xr-x')
  56. # Tools
  57. executable('megapixels-list-devices', 'tools/list_devices.c', 'device.c', dependencies: [gtkdep], install: true)
  58. executable('megapixels-camera-test', 'tools/camera_test.c', 'camera.c', 'device.c', dependencies: [gtkdep], install: true)
  59. test_quickpreview = executable('test_quickpreview', 'tests/test_quickpreview.c', 'quickpreview.c', 'camera.c', dependencies: [gtkdep])
  60. test('quickpreview', test_quickpreview)