meson.build 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. project('megapixels', 'c', version: '1.3.2')
  2. gnome = import('gnome')
  3. gtkdep = dependency('gtk4')
  4. tiff = dependency('libtiff-4')
  5. zbar = dependency('zbar')
  6. threads = dependency('threads')
  7. # gl = dependency('gl')
  8. epoxy = dependency('epoxy')
  9. cc = meson.get_compiler('c')
  10. libm = cc.find_library('m', required: false)
  11. subdir('data')
  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. add_global_arguments('-DVERSION="@0@"'.format(meson.project_version()), language: 'c')
  19. # Define DEBUG for debug builds only (debugoptimized is not included on this one)
  20. if get_option('buildtype') == 'debug'
  21. add_global_arguments('-DDEBUG', language: 'c')
  22. endif
  23. # Workaround for libtiff having ABI changes but not changing the internal
  24. # version number
  25. if get_option('tiffcfapattern')
  26. add_global_arguments('-DLIBTIFF_CFA_PATTERN', language: 'c')
  27. endif
  28. executable('megapixels',
  29. 'src/camera.c',
  30. 'src/camera_config.c',
  31. 'src/device.c',
  32. 'src/flash.c',
  33. 'src/gl_util.c',
  34. 'src/gles2_debayer.c',
  35. 'src/ini.c',
  36. 'src/io_pipeline.c',
  37. 'src/main.c',
  38. 'src/matrix.c',
  39. 'src/pipeline.c',
  40. 'src/process_pipeline.c',
  41. 'src/zbar_pipeline.c',
  42. resources,
  43. include_directories: 'src/',
  44. dependencies: [gtkdep, libm, tiff, zbar, threads, epoxy],
  45. install: true,
  46. link_args: '-Wl,-ldl')
  47. install_data(
  48. [
  49. 'config/pine64,pinephone-1.0.ini',
  50. 'config/pine64,pinephone-1.1.ini',
  51. 'config/pine64,pinephone-1.2.ini',
  52. 'config/pine64,pinetab.ini',
  53. ],
  54. install_dir: get_option('datadir') / 'megapixels/config/')
  55. # Tools
  56. executable('megapixels-list-devices',
  57. 'tools/list_devices.c',
  58. 'src/device.c',
  59. include_directories: 'src/',
  60. dependencies: [gtkdep],
  61. install: true)
  62. executable('megapixels-camera-test',
  63. 'tools/camera_test.c',
  64. 'src/camera.c',
  65. 'src/device.c',
  66. include_directories: 'src/',
  67. dependencies: [gtkdep],
  68. install: true)