On 2/26/21 4:11 PM, Chris Mayo wrote:
Allow the directory to be chosen at installation time, to support local
conventions e.g. versioning.
Signed-off-by: Chris Mayo <aklhfex@xxxxxxxxx>
---
Reviewed-by: Daniel Henrique Barboza <danielhb413@xxxxxxxxx>
meson.build | 6 +++++-
meson_options.txt | 1 +
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index 369548f127..5c7a335947 100644
--- a/meson.build
+++ b/meson.build
@@ -83,8 +83,12 @@ mandir = prefix / get_option('mandir')
sbindir = prefix / get_option('sbindir')
sharedstatedir = prefix / get_option('sharedstatedir')
+docdir = get_option('docdir')
+if docdir == ''
+ docdir = datadir / 'doc' / meson.project_name()
+endif
+
confdir = sysconfdir / meson.project_name()
-docdir = datadir / 'doc' / meson.project_name()
pkgdatadir = datadir / meson.project_name()
diff --git a/meson_options.txt b/meson_options.txt
index e5d79c2b6b..2606648b64 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -7,6 +7,7 @@ option('expensive_tests', type: 'feature', value: 'auto', description: 'set the
option('test_coverage', type: 'boolean', value: false, description: 'turn on code coverage instrumentation')
option('git_werror', type: 'feature', value: 'auto', description: 'use -Werror if building from GIT')
option('rpath', type: 'feature', value: 'auto', description: 'whether to include rpath information in installed binaries and libraries')
+option('docdir', type: 'string', value: '', description: 'documentation installation directory')
option('docs', type: 'feature', value: 'auto', description: 'whether to generate documentation')
option('tests', type: 'feature', value: 'auto', description: 'whether to build tests')