meson.build 4.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. #********************************************************************
  2. # Copyright 2014-2022 Daniel 'grindhold' Brendle
  3. #
  4. # This file is part of libgtkflow.
  5. #
  6. # libgtkflow is free software: you can redistribute it and/or
  7. # modify it under the terms of the GNU Lesser General Public License
  8. # as published by the Free Software Foundation, either
  9. # version 3 of the License, or (at your option) any later
  10. # version.
  11. #
  12. # libgtkflow is distributed in the hope that it will be
  13. # useful, but WITHOUT ANY WARRANTY; without even the implied
  14. # warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  15. # PURPOSE. See the GNU Lesser General Public License for more details.
  16. #
  17. # You should have received a copy of the GNU Lesser General Public
  18. # License along with libgtkflow.
  19. # If not, see http://www.gnu.org/licenses/.
  20. #********************************************************************
  21. src = files([
  22. 'dock.vala',
  23. 'minimap.vala',
  24. 'node.vala',
  25. 'nodeview.vala',
  26. ])
  27. gtkflow4_api = '0.2'
  28. gtkflow4 = library('gtkflow4-' + gtkflow4_api,
  29. src,
  30. dependencies: [glib, gobject, gtk4, math],
  31. link_with: gflow,
  32. include_directories: gflow_inc,
  33. vala_gir: 'GtkFlow4-' + gtkflow4_api + '.gir',
  34. install: true)
  35. gtkflow4_inc = include_directories('.')
  36. custom_target('gtkflow4-typelib',
  37. command: [g_ir_compiler, '--output', '@OUTPUT@', meson.current_build_dir() + '/GtkFlow4-' + gtkflow4_api + '.gir',
  38. '--includedir', gflow_girdir,
  39. '--shared-library', get_option('prefix') + '/' + get_option('libdir') + '/libgtkflow4-'+ gtkflow4_api +'.so'],
  40. output: 'GtkFlow4-' + gtkflow4_api + '.typelib',
  41. depends: gtkflow4,
  42. install: true,
  43. install_dir: get_option('libdir') + '/girepository-1.0')
  44. girfilename4 = meson.current_build_dir() + '/GtkFlow4-' + gtkflow4_api + '.gir'
  45. run_command('touch', girfilename4)
  46. install_data(sources: girfilename4,
  47. install_dir: get_option('datadir') + '/gir-1.0')
  48. vapifilename4 = meson.current_build_dir() + '/gtkflow4-' + gtkflow4_api + '.vapi'
  49. run_command('touch', vapifilename4)
  50. install_data(sources: vapifilename4,
  51. install_dir: get_option('datadir') + '/vala/vapi')
  52. headerfilename4 = meson.current_build_dir () + '/gtkflow4-' + gtkflow4_api + '.h'
  53. run_command('touch', headerfilename4)
  54. install_headers(headerfilename4,
  55. subdir: 'gtkflow4-' + gtkflow4_api)
  56. install_data(sources: [meson.current_source_dir() + '/gtkflow4-' + gtkflow4_api + '.deps'],
  57. install_dir: get_option('datadir') + '/vala/vapi')
  58. pkgconfig.generate(libraries: [gflow, gtkflow4],
  59. subdirs: 'gtkflow4-' + gtkflow4_api,
  60. version: gtkflow4_api,
  61. name: 'gtkflow4',
  62. filebase: 'gtkflow4-' + gtkflow4_api,
  63. requires: ['glib-2.0', 'gobject-2.0', 'gflow-' + gflow_api],
  64. description: 'A library to create flowgraphs in GTK+')
  65. if get_option('enable_valadoc')
  66. valadoc = find_program('valadoc')
  67. gtkflow4_docs = custom_target('gtkflow_apidocs',
  68. depends: gflow,
  69. input: src,
  70. install: true,
  71. # FIXME: Installing to tmp, so the target will be built
  72. # the problem is we cannot access a subfolder of the
  73. # buildtarget via the output parameter.
  74. # Find a nicer solution
  75. install_dir: '/tmp',
  76. command: [valadoc, '-o', 'libgtkflow/gtkflow4-' + gtkflow4_api, '--doclet', 'devhelp', '@INPUT@',
  77. '--pkg', 'gtk4', '--vapidir=' + meson.current_build_dir() + '/../libgflow/', '--pkg', 'gflow-' + gflow_api,
  78. '--force'],
  79. output: 'gtkflow4-'+ gtkflow4_api)
  80. install_subdir(meson.current_build_dir() + '/gtkflow4-' + gtkflow4_api + '/gtkflow4-' + gtkflow4_api,
  81. install_dir: get_option('datadir') + '/devhelp/books',
  82. )
  83. endif