Minos Galanakis | d19a19f | 2020-06-03 15:38:03 +0100 | [diff] [blame^] | 1 | # ----------------------------------------------------------------------------- |
| 2 | # Copyright (c) 2020, Arm Limited. All rights reserved. |
| 3 | # |
| 4 | # SPDX-License-Identifier: BSD-3-Clause |
| 5 | # |
| 6 | # ----------------------------------------------------------------------------- |
| 7 | # |
| 8 | # Configuration file override for the Sphinx documentation builder. |
| 9 | # |
| 10 | # This file is used when Sphinx build is invoked directly at this level. |
| 11 | # It will trigger a copy-files operation and render a new configuration |
| 12 | # using either auto-detected or cmake provided parameters. |
| 13 | import os |
| 14 | import sys |
| 15 | |
| 16 | # Attempt to find the tools directory by recursing up to five levels of parents |
| 17 | root_path = os.path.dirname(os.path.abspath(__file__)) |
| 18 | |
| 19 | for i in range(5): |
| 20 | root_path = os.path.dirname(root_path) |
| 21 | doc_path = os.path.join(root_path, "tools", "documentation") |
| 22 | if os.path.isdir(doc_path): |
| 23 | sys.path.insert(0, os.path.abspath(doc_path)) |
| 24 | sys.path.append("./") |
| 25 | |
| 26 | # Trigger the copy operation logic |
| 27 | import tfm_copy_files |
| 28 | |
| 29 | # Import the rendered configuration into global scope |
| 30 | from tfm_cmake_defaults import * |
| 31 | |
| 32 | from conf_rendered import * |