meson.build 2.6 KB

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