meson.build 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. prg_install = find_program('install')
  2. doxygen = find_program('doxygen', required : false)
  3. if not doxygen.found()
  4. error('Program "doxygen" not found or not executable. Try building with -Ddocumentation=false')
  5. endif
  6. dot = find_program('dot', required : false)
  7. if not dot.found()
  8. error('Program "dot" not found or not executable. Try building with -Ddocumentation=false')
  9. endif
  10. mainpage = vcs_tag(command : ['git', 'log', '-1', '--format=%h'],
  11. fallback : 'unknown',
  12. input : 'mainpage.dox',
  13. output : 'mainpage.dox',
  14. replace_string: '__GIT_VERSION__')
  15. src_doxygen = files(
  16. # source files
  17. '../../src/libinput.h',
  18. # style files
  19. 'style/header.html',
  20. 'style/footer.html',
  21. 'style/customdoxygen.css',
  22. 'style/bootstrap.css',
  23. 'style/libinputdoxygen.css',
  24. )
  25. doxyfiles = []
  26. foreach f : src_doxygen
  27. df = configure_file(input: f,
  28. output: '@PLAINNAME@',
  29. copy : true)
  30. doxyfiles += [ df ]
  31. endforeach
  32. doc_config = configuration_data()
  33. doc_config.set('PACKAGE_NAME', meson.project_name())
  34. doc_config.set('PACKAGE_VERSION', meson.project_version())
  35. doc_config.set('builddir', meson.current_build_dir())
  36. doxyfile = configure_file(input : 'libinput.doxygen.in',
  37. output : 'libinput.doxygen',
  38. configuration : doc_config)
  39. custom_target('doxygen',
  40. input : [ doxyfiles, doxyfile, mainpage ] + src_doxygen,
  41. output : [ 'html' ],
  42. command : [ doxygen, doxyfile ],
  43. install : false,
  44. depends: [ mainpage ],
  45. build_by_default : true)