meson.build 3.9 KB

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