diff --git a/daemon/meson.build b/daemon/meson.build index 205e662..0c25bcd 100644 --- a/daemon/meson.build +++ b/daemon/meson.build @@ -11,6 +11,7 @@ install_headers('x52dcomm.h', subdir: meson.project_name()) lib_libx52dcomm = library('x52dcomm', libx52dcomm_sources, dependencies: [dep_intl], version: libx52dcomm_version, + install: true, include_directories: includes) x52d_sources = [ diff --git a/install-doxygen-docs.sh b/install-doxygen-docs.sh new file mode 100755 index 0000000..2480cef --- /dev/null +++ b/install-doxygen-docs.sh @@ -0,0 +1,17 @@ +#!/bin/sh +# Install Doxygen HTML and man trees from the build directory. +# Arguments are paths relative to the install prefix (MESON_INSTALL_DESTDIR_PREFIX). +set -e + +doc_html="$1" +mandir="$2" + +if [ -d "$MESON_BUILD_ROOT/docs/html" ]; then + mkdir -p "$MESON_INSTALL_DESTDIR_PREFIX/$doc_html" + cp -R "$MESON_BUILD_ROOT/docs/html"/. "$MESON_INSTALL_DESTDIR_PREFIX/$doc_html/" +fi + +if [ -d "$MESON_BUILD_ROOT/docs/man" ]; then + mkdir -p "$MESON_INSTALL_DESTDIR_PREFIX/$mandir" + cp -R "$MESON_BUILD_ROOT/docs/man"/. "$MESON_INSTALL_DESTDIR_PREFIX/$mandir/" +fi diff --git a/meson.build b/meson.build index e432058..fb52929 100644 --- a/meson.build +++ b/meson.build @@ -1,6 +1,7 @@ project('libx52', 'C', license: 'GPL-2.0-only WITH Classpath-exception-2.0', - version: '0.3.3') + version: '0.3.3', + meson_version: '>=0.61') dep_libusb = dependency('libusb-1.0', required: true) dep_hidapi = dependency('hidapi-hidraw', required: false) @@ -129,36 +130,20 @@ if doxygen_program.found() configuration: { 'PACKAGE_NAME': meson.project_name(), 'PACKAGE_VERSION': meson.project_version(), - 'abs_top_builddir': meson.build_root(), - 'abs_top_srcdir': meson.source_root(), + 'abs_top_builddir': meson.project_build_root(), + 'abs_top_srcdir': meson.project_source_root(), } ) - docs_tgt = custom_target('docs', + custom_target('docs', depend_files: [doxyfile, 'DoxygenLayout.xml'], command: [doxygen_program], output: 'docs' ) - install_subdir(meson.current_build_dir() / 'docs' / 'html', - install_dir: get_option('prefix') / get_option('datadir') / 'doc' / meson.project_name(), - strip_directory: true - ) - - wanted_man_pages = ['x52cli.1', 'x52bugreport.1'] - foreach p: wanted_man_pages - section = 'man' + p.split('.')[-1] # Extracts the section - - custom_target(p, - input: docs_tgt, - output: p, - command: ['cp', meson.current_build_dir() / 'docs' / 'man' / section / p, '@OUTPUT@'], - install: true, - install_dir: get_option('prefix') / get_option('mandir') / section - ) - endforeach - install_subdir(meson.current_build_dir() / 'docs' / 'man', - install_dir: get_option('prefix') / get_option('mandir'), - strip_directory: true + meson.add_install_script( + 'install-doxygen-docs.sh', + get_option('datadir') / 'doc' / meson.project_name(), + get_option('mandir'), ) endif