meson.build 2.3 KB

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