sphinx_build = venv_directory.joinpath("bin").joinpath("sphinx-build")
if args.pdf_name:
- buildargs = [
+ build_args = [
sphinx_build,
"-M",
"latexpdf",
'.'
]
else:
- buildargs = [
+ build_args = [
sphinx_build,
"-b",
"html",
target_directory,
]
subprocess.run(
- buildargs + files, # default is to do all
+ build_args + files, # if files is empty, it means do all files
check=True
)
if args.pdf_name:
endforeach
endif
-html_docs = custom_target(
- 'html-docs',
- command: [
- python,
- product_source_dir / docs_dir / 'generate-docs.py',
- '--build-root', '@BUILD_ROOT@',
- '--source-root', '@SOURCE_ROOT@',
- '--venv-name', 'venv-docs',
- '--requirements-file', docs_dir / 'requirements.txt',
- '--source-directory', docs_dir,
- '--target-directory', '@BUILD_ROOT@' / 'html-docs',
- ],
- output: 'html-docs',
- console: true,
-)
-
-docs_tarball = custom_target(
- 'html-docs.tar.bz2',
- command: ['tar', 'cjf', 'html-docs.tar.bz2', html_docs],
- output: 'html-docs.tar.bz2',
-)
+if python.found()
+ html_docs = custom_target(
+ 'html-docs',
+ command: [
+ python,
+ product_source_dir / docs_dir / 'generate-docs.py',
+ '--build-root', '@BUILD_ROOT@',
+ '--source-root', '@SOURCE_ROOT@',
+ '--venv-name', 'venv-docs',
+ '--requirements-file', docs_dir / 'requirements.txt',
+ '--source-directory', docs_dir,
+ '--target-directory', '@BUILD_ROOT@' / 'html-docs',
+ ],
+ output: 'html-docs',
+ console: true,
+ )
-pdf_docs = custom_target(
- command: [
- python,
- product_source_dir / docs_dir / 'generate-docs.py',
- '--build-root', '@BUILD_ROOT@',
- '--source-root', '@SOURCE_ROOT@',
- '--venv-name', 'venv-docs',
- '--requirements-file', docs_dir / 'requirements.txt',
- '--source-directory', docs_dir,
- '--target-directory', '@BUILD_ROOT@',
- '--pdf-name', 'PowerDNS-Authoritative.pdf',
- ],
- output: 'PowerDNS-Authoritative.pdf',
- console: true,
-)
+ docs_tarball = custom_target(
+ 'html-docs.tar.bz2',
+ command: ['tar', 'cjf', 'html-docs.tar.bz2', html_docs],
+ output: 'html-docs.tar.bz2',
+ )
-run_target(
- 'all-docs',
- # args mentioned in command line become auto-dependency
- command: ['echo', 'Generated', html_docs, docs_tarball, pdf_docs],
-)
+ pdf_docs = custom_target(
+ command: [
+ python,
+ product_source_dir / docs_dir / 'generate-docs.py',
+ '--build-root', '@BUILD_ROOT@',
+ '--source-root', '@SOURCE_ROOT@',
+ '--venv-name', 'venv-docs',
+ '--requirements-file', docs_dir / 'requirements.txt',
+ '--source-directory', docs_dir,
+ '--target-directory', '@BUILD_ROOT@',
+ '--pdf-name', 'PowerDNS-Authoritative.pdf',
+ ],
+ output: 'PowerDNS-Authoritative.pdf',
+ console: true,
+ )
+ run_target(
+ 'all-docs',
+ # args mentioned in command line become auto-dependency
+ command: ['echo', 'Generated', html_docs, docs_tarball, pdf_docs],
+ )
+endif
follow_symlinks: true
)
-html_docs = custom_target(
- 'html-docs',
- command: [
- python,
- product_source_dir / docs_dir / 'generate-docs.py',
- '--build-root', '@BUILD_ROOT@',
- '--source-root', '@SOURCE_ROOT@',
- '--venv-name', 'venv-docs',
- '--requirements-file', docs_dir / 'requirements.txt',
- '--source-directory', docs_dir,
- '--target-directory', '@BUILD_ROOT@' / 'html-docs',
- ],
- output: 'html-docs',
- console: true,
-)
+if python.found()
+ html_docs = custom_target(
+ 'html-docs',
+ command: [
+ python,
+ product_source_dir / docs_dir / 'generate-docs.py',
+ '--build-root', '@BUILD_ROOT@',
+ '--source-root', '@SOURCE_ROOT@',
+ '--venv-name', 'venv-docs',
+ '--requirements-file', docs_dir / 'requirements.txt',
+ '--source-directory', docs_dir,
+ '--target-directory', '@BUILD_ROOT@' / 'html-docs',
+ ],
+ output: 'html-docs',
+ console: true,
+ )
-docs_tarball = custom_target(
- 'html-docs.tar.bz2',
- command: ['tar', 'cjf', 'html-docs.tar.bz2', html_docs],
- output: 'html-docs.tar.bz2',
-)
+ docs_tarball = custom_target(
+ 'html-docs.tar.bz2',
+ command: ['tar', 'cjf', 'html-docs.tar.bz2', html_docs],
+ output: 'html-docs.tar.bz2',
+ )
-pdf_docs = custom_target(
- command: [
- python,
- product_source_dir / docs_dir / 'generate-docs.py',
- '--build-root', '@BUILD_ROOT@',
- '--source-root', '@SOURCE_ROOT@',
- '--venv-name', 'venv-docs',
- '--requirements-file', docs_dir / 'requirements.txt',
- '--source-directory', docs_dir,
- '--target-directory', '@BUILD_ROOT@',
- '--pdf-name', 'dnsdist.pdf',
- ],
- output: 'dnsdist.pdf',
- console: true,
-)
+ pdf_docs = custom_target(
+ command: [
+ python,
+ product_source_dir / docs_dir / 'generate-docs.py',
+ '--build-root', '@BUILD_ROOT@',
+ '--source-root', '@SOURCE_ROOT@',
+ '--venv-name', 'venv-docs',
+ '--requirements-file', docs_dir / 'requirements.txt',
+ '--source-directory', docs_dir,
+ '--target-directory', '@BUILD_ROOT@',
+ '--pdf-name', 'dnsdist.pdf',
+ ],
+ output: 'dnsdist.pdf',
+ console: true,
+ )
-run_target(
- 'all-docs',
- # args mentioned in command line become auto-dependency
- command: ['echo', 'Generated', html_docs, docs_tarball, pdf_docs],
-)
+ run_target(
+ 'all-docs',
+ # args mentioned in command line become auto-dependency
+ command: ['echo', 'Generated', html_docs, docs_tarball, pdf_docs],
+ )
+endif
\ No newline at end of file
install_dir: get_option('sysconfdir'),
)
-html_docs = custom_target(
- 'html-docs',
- command: [
- python,
- product_source_dir / docs_dir / 'generate-docs.py',
- '--build-root', '@BUILD_ROOT@',
- '--source-root', '@SOURCE_ROOT@',
- '--venv-name', 'venv-docs',
- '--requirements-file', docs_dir / 'requirements.txt',
- '--source-directory', docs_dir,
- '--target-directory', '@BUILD_ROOT@' / 'html-docs',
- ],
- output: 'html-docs',
- console: true,
-)
-
-docs_tarball = custom_target(
- 'html-docs.tar.bz2',
- command: ['tar', 'cjf', 'html-docs.tar.bz2', html_docs],
- output: 'html-docs.tar.bz2',
-)
+if python.found()
+ html_docs = custom_target(
+ 'html-docs',
+ command: [
+ python,
+ product_source_dir / docs_dir / 'generate-docs.py',
+ '--build-root', '@BUILD_ROOT@',
+ '--source-root', '@SOURCE_ROOT@',
+ '--venv-name', 'venv-docs',
+ '--requirements-file', docs_dir / 'requirements.txt',
+ '--source-directory', docs_dir,
+ '--target-directory', '@BUILD_ROOT@' / 'html-docs',
+ ],
+ output: 'html-docs',
+ console: true,
+ )
-pdf_docs = custom_target(
- command: [
- python,
- product_source_dir / docs_dir / 'generate-docs.py',
- '--build-root', '@BUILD_ROOT@',
- '--source-root', '@SOURCE_ROOT@',
- '--venv-name', 'venv-docs',
- '--requirements-file', docs_dir / 'requirements.txt',
- '--source-directory', docs_dir,
- '--target-directory', '@BUILD_ROOT@',
- '--pdf-name', 'PowerDNS-Recursor.pdf',
- ],
- output: 'PowerDNS-Recursor.pdf',
- console: true,
-)
+ docs_tarball = custom_target(
+ 'html-docs.tar.bz2',
+ command: ['tar', 'cjf', 'html-docs.tar.bz2', html_docs],
+ output: 'html-docs.tar.bz2',
+ )
-run_target(
- 'all-docs',
- # args mentioned in command line become auto-dependency
- command: ['echo', 'Generated', html_docs, docs_tarball, pdf_docs],
-)
+ pdf_docs = custom_target(
+ command: [
+ python,
+ product_source_dir / docs_dir / 'generate-docs.py',
+ '--build-root', '@BUILD_ROOT@',
+ '--source-root', '@SOURCE_ROOT@',
+ '--venv-name', 'venv-docs',
+ '--requirements-file', docs_dir / 'requirements.txt',
+ '--source-directory', docs_dir,
+ '--target-directory', '@BUILD_ROOT@',
+ '--pdf-name', 'PowerDNS-Recursor.pdf',
+ ],
+ output: 'PowerDNS-Recursor.pdf',
+ console: true,
+ )
+ run_target(
+ 'all-docs',
+ # args mentioned in command line become auto-dependency
+ command: ['echo', 'Generated', html_docs, docs_tarball, pdf_docs],
+ )
+endif