aboutsummaryrefslogtreecommitdiffstats
path: root/doc/cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2021-01-06 23:53:33 +0100
committerDavid Robillard <d@drobilla.net>2021-01-08 18:13:49 +0100
commit69d5d2adde1d13578a94e8b1934235987cf9b2bd (patch)
tree9720c044447bb12e6e714ac969ebb7b0daf87c5f /doc/cpp
parent94e30b9c3c188dfdf4765f026872f95ea3cfdda2 (diff)
downloadpugl-69d5d2adde1d13578a94e8b1934235987cf9b2bd.tar.gz
pugl-69d5d2adde1d13578a94e8b1934235987cf9b2bd.tar.bz2
pugl-69d5d2adde1d13578a94e8b1934235987cf9b2bd.zip
Switch to Meson
Diffstat (limited to 'doc/cpp')
-rw-r--r--doc/cpp/Doxyfile.in (renamed from doc/cpp/Doxyfile)14
-rw-r--r--doc/cpp/api/meson.build5
-rw-r--r--doc/cpp/meson.build43
-rw-r--r--doc/cpp/wscript44
-rw-r--r--doc/cpp/xml/meson.build21
5 files changed, 72 insertions, 55 deletions
diff --git a/doc/cpp/Doxyfile b/doc/cpp/Doxyfile.in
index 517ba05..889ac0b 100644
--- a/doc/cpp/Doxyfile
+++ b/doc/cpp/Doxyfile.in
@@ -26,15 +26,7 @@ SHOW_FILES = NO
MACRO_EXPANSION = YES
PREDEFINED = PUGL_API PUGL_DISABLE_DEPRECATED PUGL_CONST_API= PUGL_CONST_FUNC=
-INPUT = ../../include/pugl/cairo.h \
- ../../include/pugl/gl.h \
- ../../include/pugl/pugl.h \
- ../../include/pugl/stub.h \
- ../../include/pugl/vulkan.h \
- ../../bindings/cxx/include/pugl/cairo.hpp \
- ../../bindings/cxx/include/pugl/gl.hpp \
- ../../bindings/cxx/include/pugl/pugl.hpp \
- ../../bindings/cxx/include/pugl/stub.hpp \
- ../../bindings/cxx/include/pugl/vulkan.hpp
+STRIP_FROM_PATH = @PUGL_SRCDIR@
+INPUT = @PUGL_HEADERS@
-OUTPUT_DIRECTORY = .
+OUTPUT_DIRECTORY = doc/cpp
diff --git a/doc/cpp/api/meson.build b/doc/cpp/api/meson.build
new file mode 100644
index 0000000..4bbbec2
--- /dev/null
+++ b/doc/cpp/api/meson.build
@@ -0,0 +1,5 @@
+cpp_pugl_rst = custom_target(
+ 'C++ API ReST Documentation',
+ command: [dox_to_sphinx, '-l', 'cpp', '-f', '@INPUT@', 'doc/cpp/api'],
+ input: cpp_index_xml,
+ output: 'pugl.rst')
diff --git a/doc/cpp/meson.build b/doc/cpp/meson.build
new file mode 100644
index 0000000..d8bae11
--- /dev/null
+++ b/doc/cpp/meson.build
@@ -0,0 +1,43 @@
+config = configuration_data()
+config.set('PUGL_VERSION', meson.project_version())
+
+conf_py = configure_file(configuration: config,
+ input: '../conf.py.in',
+ output: 'conf.py')
+
+configure_file(copy: true, input: '../deployment.rst', output: 'deployment.rst')
+configure_file(copy: true, input: '../summary.rst', output: 'summary.rst')
+
+cpp_rst_files = files(
+ 'index.rst',
+ 'overview.rst',
+ 'world.rst',
+ 'view.rst',
+ 'events.rst',
+ 'event-loop.rst',
+)
+
+foreach f : cpp_rst_files
+ configure_file(copy: true, input: f, output: '@PLAINNAME@')
+endforeach
+
+subdir('xml')
+subdir('api')
+
+docs = custom_target(
+ 'C++ API Documentation (singlehtml)',
+ command: [sphinx_build, '-M', 'singlehtml', 'doc/cpp/', 'doc/cpp/', '-E', '-q', '-t', 'singlehtml'],
+ input: [cpp_rst_files, cpp_pugl_rst, cpp_index_xml],
+ output: 'singlehtml',
+ build_by_default: true,
+ install: true,
+ install_dir: docdir / 'puglxx-0')
+
+docs = custom_target(
+ 'C++ API Documentation (html)',
+ command: [sphinx_build, '-M', 'html', 'doc/cpp/', 'doc/cpp/', '-E', '-q', '-t', 'html'],
+ input: [cpp_rst_files, cpp_pugl_rst, cpp_index_xml],
+ output: 'html',
+ build_by_default: true,
+ install: true,
+ install_dir: docdir / 'puglxx-0')
diff --git a/doc/cpp/wscript b/doc/cpp/wscript
deleted file mode 100644
index 4bef6c2..0000000
--- a/doc/cpp/wscript
+++ /dev/null
@@ -1,44 +0,0 @@
-#!/usr/bin/env python
-
-def build(bld):
- dox_to_sphinx = bld.path.find_node("../../scripts/dox_to_sphinx.py")
- index_xml = bld.path.get_bld().make_node("xml/index.xml")
-
- files = [
- ("../../resources/pugl.svg", "sphinx/_static/pugl.svg"),
- ("../deployment.rst", "sphinx/deployment.rst"),
- ("../summary.rst", "sphinx/summary.rst"),
- ("event-loop.rst", "sphinx/event-loop.rst"),
- ("events.rst", "sphinx/events.rst"),
- ("index.rst", "sphinx/index.rst"),
- ("overview.rst", "sphinx/overview.rst"),
- ("view.rst", "sphinx/view.rst"),
- ("world.rst", "sphinx/world.rst"),
- ]
-
- # Run Doxygen to generate XML documentation
- bld(features="doxygen", doxyfile="Doxyfile")
-
- # Substitute variables to make Sphinx configuration file
- bld(features="subst",
- source="../conf.py.in",
- target="sphinx/conf.py",
- PUGL_VERSION=bld.env.PUGL_VERSION)
-
- # Copy static documentation files to Sphinx build directory
- for f in files:
- bld(features="subst", is_copy=True, source=f[0], target=f[1])
-
- # Generate Sphinx markup from Doxygen XML
- bld.add_group()
- bld(rule="${PYTHON} " + dox_to_sphinx.abspath() + " -l cpp -f ${SRC} ${TGT}",
- source=index_xml,
- target="sphinx/api/")
-
- # Run Sphinx to generate HTML documentation
- doc_dir = bld.env.DOCDIR + "/pugl-%s/" % bld.env.PUGL_MAJOR_VERSION
- bld(features="sphinx",
- sphinx_source=bld.path.get_bld().make_node("sphinx"),
- sphinx_output_format="singlehtml",
- sphinx_options=["-E", "-q", "-t", "singlehtml"],
- install_path=doc_dir + "cpp/singlehtml/")
diff --git a/doc/cpp/xml/meson.build b/doc/cpp/xml/meson.build
new file mode 100644
index 0000000..3f87f2a
--- /dev/null
+++ b/doc/cpp/xml/meson.build
@@ -0,0 +1,21 @@
+doxygen = find_program('doxygen')
+
+cpp_doxygen_input = []
+foreach h : c_headers + cpp_headers
+ cpp_doxygen_input += ['..' / h]
+endforeach
+
+config = configuration_data()
+config.set('PUGL_HEADERS', ' '.join(cpp_doxygen_input))
+config.set('PUGL_SRCDIR', pugl_src_root)
+
+cpp_doxyfile = configure_file(configuration: config,
+ input: '../Doxyfile.in',
+ output: 'Doxyfile')
+
+cpp_index_xml = custom_target(
+ 'cpp-index.xml',
+ command: [doxygen, '@INPUT0@'],
+ input: [cpp_doxyfile] + c_header_files + cpp_header_files,
+ output: 'index.xml')
+