meson.build 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. executable('megapixels', 'main.c', 'ini.c', 'quickpreview.c', 'camera.c', 'device.c', 'pipeline.c', 'camera_config.c', 'io_pipeline.c', 'process_pipeline.c', resources, dependencies : [gtkdep, libm, tiff, threads], install : true)
  20. install_data(['data/org.postmarketos.Megapixels.desktop'],
  21. install_dir : get_option('datadir') / 'applications')
  22. install_data(['data/org.postmarketos.Megapixels.metainfo.xml'],
  23. install_dir : get_option('datadir') / 'metainfo')
  24. install_data('data/org.postmarketos.Megapixels.svg',
  25. install_dir: join_paths(get_option('datadir'), 'icons/hicolor/scalable/apps')
  26. )
  27. install_data([
  28. 'config/pine64,pinephone-1.0.ini',
  29. 'config/pine64,pinephone-1.1.ini',
  30. 'config/pine64,pinephone-1.2.ini',
  31. 'config/pine64,pinetab.ini',
  32. ],
  33. install_dir : get_option('datadir') / 'megapixels/config/')
  34. install_data(['postprocess.sh'],
  35. install_dir : get_option('datadir') / 'megapixels/',
  36. install_mode: 'rwxr-xr-x')
  37. # Tools
  38. executable('list_devices', 'tools/list_devices.c', 'device.c', dependencies: [gtkdep])
  39. executable('camera_test', 'tools/camera_test.c', 'camera.c', 'device.c', dependencies: [gtkdep])
  40. test_quickpreview = executable('test_quickpreview', 'tests/test_quickpreview.c', 'quickpreview.c', 'camera.c', dependencies: [gtkdep])
  41. test('quickpreview', test_quickpreview)