meson.build 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. project('jp2-pixbuf-loader', 'c', version: '0.0.3')
  2. gdk_pixbuf = dependency('gdk-pixbuf-2.0', method: 'pkg-config')
  3. gdk_pixbuf_moduledir = gdk_pixbuf.get_pkgconfig_variable('gdk_pixbuf_moduledir', define_variable: ['prefix', get_option('prefix')])
  4. gdk_pixbuf_query_loaders = gdk_pixbuf.get_pkgconfig_variable('gdk_pixbuf_query_loaders')
  5. gdk_pixbuf_query_loaders = find_program(get_option('gdk_pixbuf_query_loaders_path'), gdk_pixbuf_query_loaders, gdk_pixbuf_query_loaders+'-32', gdk_pixbuf_query_loaders+'-64')
  6. cc = meson.get_compiler('c')
  7. openjpeg = dependency('libopenjp2', method: 'pkg-config', required: cc.get_argument_syntax() != 'msvc')
  8. if not openjpeg.found()
  9. openjpeg = dependency('OpenJPEG', method: 'cmake')
  10. endif
  11. if get_option('buildtype') == 'debug'
  12. add_global_arguments('-DDEBUG=TRUE', language: 'c')
  13. endif
  14. pixbuf_loader_openjpeg = shared_module(
  15. 'pixbufloader-jp2',
  16. 'src/io-jp2.c',
  17. include_directories: 'src/',
  18. dependencies: [gdk_pixbuf, openjpeg],
  19. name_suffix: host_machine.system() == 'darwin' ? 'so' : [],
  20. install: true,
  21. install_dir: gdk_pixbuf_moduledir,
  22. )
  23. cdata = configuration_data()
  24. cdata.set('bindir', get_option('prefix') / get_option('bindir'))
  25. configure_file(
  26. input: 'jp2-pixbuf.thumbnailer.in',
  27. output: 'jp2-pixbuf.thumbnailer',
  28. configuration: cdata,
  29. install: true,
  30. install_dir: get_option('datadir') / 'thumbnailers',
  31. )
  32. meson.add_install_script(gdk_pixbuf_query_loaders.path(), '--update-cache')
  33. subdir('tests')