meson.build 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. project('libmegapixels', 'c',
  2. version: '0.1.0',
  3. license: 'GPL',
  4. )
  5. libconfig = dependency('libconfig')
  6. # We use libtool-version numbers because it's easier to understand.
  7. # Before making a release, the libmegapixels_so_*
  8. # numbers should be modified. The components are of the form C:R:A.
  9. # a) If binary compatibility has been broken (eg removed or changed interfaces)
  10. # change to C+1:0:0.
  11. # b) If interfaces have been changed or added, but binary compatibility has
  12. # been preserved, change to C+1:0:A+1
  13. # c) If the interface is the same as the previous version, change to C:R+1:A
  14. libmegapixels_lt_c=1
  15. libmegapixels_lt_r=0
  16. libmegapixels_lt_a=0
  17. libmegapixels_so_version = '@0@.@1@.@2@'.format((libmegapixels_lt_c - libmegapixels_lt_a),
  18. libmegapixels_lt_a,
  19. libmegapixels_lt_r)
  20. inc = include_directories('include')
  21. install_headers('include/libmegapixels.h')
  22. lib_src = [
  23. 'src/findconfig.c',
  24. 'src/log.c',
  25. 'src/mode.c',
  26. 'src/util.c',
  27. 'src/parse.c',
  28. 'src/pipeline.c',
  29. ]
  30. libmegapixels = shared_library('megapixels', lib_src,
  31. version: libmegapixels_so_version,
  32. include_directories: inc,
  33. dependencies: libconfig,
  34. install: true
  35. )
  36. pkg_mod = import('pkgconfig')
  37. pkg_mod.generate(libraries: libmegapixels,
  38. version: libmegapixels_so_version,
  39. name: 'libmegapixels',
  40. filebase: 'libmegapixels',
  41. description: 'The camera control bits from Megapixels')
  42. executable('megapixels-findconfig', 'util/findconfig.c',
  43. link_with: libmegapixels,
  44. include_directories: inc,
  45. install: true,
  46. )
  47. executable('megapixels-getframe', 'util/getframe.c',
  48. link_with: libmegapixels,
  49. include_directories: inc,
  50. install: true,
  51. )
  52. install_data(
  53. [
  54. 'config/pine64,pinephone.conf',
  55. 'config/pine64,pinetab.conf',
  56. 'config/purism,librem5.conf',
  57. ],
  58. install_dir: get_option('datadir') / 'megapixels/config/'
  59. )