meson.build 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. src = files([
  2. 'dock_renderer.vala',
  3. 'node_renderer.vala',
  4. 'default_node_renderer.vala',
  5. 'dockline_node_renderer.vala',
  6. 'minimap.vala',
  7. 'node.vala',
  8. 'nodeview.vala',
  9. 'layout.vala',
  10. 'drawinghelper.c'
  11. ])
  12. gtkflow3_api = '1.0'
  13. gflow_dep_api = '1.0'
  14. gtkflow3_deps = [glib, gobject, gtk3, math]
  15. gtkflow3_links = []
  16. if get_option('enable_gflow') == false
  17. gflow_dep = dependency('gflow-'+gflow_dep_api)
  18. gtkflow3_deps += gflow_dep
  19. else
  20. gtkflow3_links += gflow
  21. endif
  22. gtkflow3 = library('gtkflow3-' + gtkflow3_api,
  23. src,
  24. dependencies: gtkflow3_deps,
  25. link_with: gtkflow3_links,
  26. include_directories: gflow_inc,
  27. vala_gir: 'GtkFlow3-' + gtkflow3_api + '.gir',
  28. install: true)
  29. gtkflow3_inc = include_directories('.')
  30. custom_target('gtkflow3-typelib',
  31. command: [g_ir_compiler, '--output', '@OUTPUT@', meson.current_build_dir() + '/GtkFlow3-' + gtkflow3_api + '.gir',
  32. '--includedir', gflow_girdir,
  33. '--shared-library', get_option('prefix') + '/' + get_option('libdir') + '/libgtkflow3-'+ gtkflow3_api +'.so'],
  34. output: 'GtkFlow3-' + gtkflow3_api + '.typelib',
  35. depends: gtkflow3,
  36. install: true,
  37. install_dir: get_option('libdir') + '/girepository-1.0')
  38. girfilename3 = meson.current_build_dir() + '/GtkFlow3-' + gtkflow3_api + '.gir'
  39. run_command('touch', girfilename3)
  40. install_data(sources: girfilename3,
  41. install_dir: get_option('datadir') + '/gir-1.0')
  42. vapifilename3 = meson.current_build_dir() + '/gtkflow3-' + gtkflow3_api + '.vapi'
  43. run_command('touch', vapifilename3)
  44. install_data(sources: vapifilename3,
  45. install_dir: get_option('datadir') + '/vala/vapi')
  46. headerfilename3 = meson.current_build_dir () + '/gtkflow3-' + gtkflow3_api + '.h'
  47. run_command('touch', headerfilename3)
  48. install_headers(headerfilename3,
  49. subdir: 'gtkflow3-' + gtkflow3_api)
  50. install_data(sources: [meson.current_source_dir() + '/gtkflow3-' + gtkflow3_api + '.deps'],
  51. install_dir: get_option('datadir') + '/vala/vapi')
  52. pkgconfig.generate(libraries: [gtkflow3],
  53. subdirs: 'gtkflow3-' + gtkflow3_api,
  54. version: gtkflow3_api,
  55. name: 'gtkflow3',
  56. filebase: 'gtkflow3-' + gtkflow3_api,
  57. requires: ['glib-2.0', 'gobject-2.0', 'gflow-' + gflow_dep_api],
  58. description: 'A library to create flowgraphs in GTK+')
  59. if get_option('enable_valadoc')
  60. valadoc = find_program('valadoc')
  61. gtkflow3_docs = custom_target('gtkflow_apidocs',
  62. depends: gflow,
  63. input: src,
  64. install: true,
  65. # FIXME: Installing to tmp, so the target will be built
  66. # the problem is we cannot access a subfolder of the
  67. # buildtarget via the output parameter.
  68. # Find a nicer solution
  69. install_dir: '/tmp',
  70. command: [valadoc, '-o', meson.current_build_dir() + '/gtkflow3-' + gtkflow3_api, '--doclet', 'devhelp', '@INPUT@',
  71. '--pkg', 'gtk+-3.0', '--vapidir=' + meson.current_build_dir() + '/../libgflow/', '--pkg', 'gflow-' + gflow_dep_api,
  72. '--force'],
  73. output: 'gtkflow3-'+ gtkflow3_api)
  74. install_subdir(meson.current_build_dir() + '/gtkflow3-' + gtkflow3_api + '/gtkflow3-' + gtkflow3_api,
  75. install_dir: get_option('datadir') + '/devhelp/books',
  76. )
  77. endif