meson: Add documentation installation directory option

Allow the directory to be chosen at installation time, to support local
conventions e.g. versioning.

Signed-off-by: Chris Mayo <aklhfex@gmail.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Chris Mayo 2021-02-26 19:11:06 +00:00 committed by Michal Privoznik
parent 01e206c3e3
commit ee4a392dda
2 changed files with 6 additions and 1 deletions

View File

@ -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()

View File

@ -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')