Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
117 lines (84 loc) · 3.2 KB

File metadata and controls

117 lines (84 loc) · 3.2 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# FindSphinx.cmake
# Copyright (C) 2021-2026 Manuel Sainz de Baranda y Goñi.
# This "find module" is distributed as public domain software.
#[=======================================================================[.rst:
FindSphinx
----------
Find the Sphinx documentation tools.
Optional components
^^^^^^^^^^^^^^^^^^^
This module supports 4 optional ``COMPONENTS``:
``apidoc``
Looks for the ``sphinx-apidoc`` executable.
``autogen``
Looks for the ``sphinx-autogen`` executable.
``build``
Looks for the ``sphinx-build`` executable. This component is used by default
if no components are specified.
``quickstart``
Looks for the ``sphinx-quickstart`` executable.
Result variables
^^^^^^^^^^^^^^^^
This module will set the following variables in your project:
``Sphinx_FOUND``
``TRUE`` if all requested Sphinx tools were found.
``Sphinx_<COMPONENT>_VERSION``
The version of the ``sphinx-<component>`` executable that was found, where
``<COMPONENT>`` and ``<component>`` are the uppercase and lowercase names of
the component, respectively.
``Sphinx_VERSION``
The version of Sphinx that was found. It is the same as
``Sphinx_BUILD_VERSION`` if the ``build`` component was requested; otherwise,
it is the same as the first one requested.
Cache variables
^^^^^^^^^^^^^^^
Search results are saved persistently in CMake cache entries:
``Sphinx_<COMPONENT>_EXECUTABLE``
The full path to the ``sphinx-<component>`` executable, where ``<COMPONENT>``
and ``<component>`` are the uppercase and lowercase names of the component,
respectively.
#]=======================================================================]
set(_Sphinx_required_vars)
if(NOT Sphinx_FIND_COMPONENTS)
set(Sphinx_FIND_COMPONENTS build)
endif()
foreach(_Sphinx_tool IN LISTS Sphinx_FIND_COMPONENTS)
if(NOT _Sphinx_tool MATCHES "^(apidoc|autogen|build|quickstart)$")
message(FATAL_ERROR "Invalid components: ${Sphinx_FIND_COMPONENTS}")
endif()
string(TOUPPER ${_Sphinx_tool} _Sphinx_tool_uppercase)
set(_Sphinx_tool_executable_var Sphinx_${_Sphinx_tool_uppercase}_EXECUTABLE)
set(_Sphinx_tool_version_var Sphinx_${_Sphinx_tool_uppercase}_VERSION)
list( APPEND _Sphinx_required_vars
${_Sphinx_tool_executable_var} ${_Sphinx_tool_version_var})
find_program(
${_Sphinx_tool_executable_var}
NAMES sphinx-${_Sphinx_tool}
DOC "`sphinx-${_Sphinx_tool}` executable.")
if(${_Sphinx_tool_executable_var})
execute_process(
COMMAND "${${_Sphinx_tool_executable_var}}" --version
OUTPUT_VARIABLE _Sphinx_output)
if("${_Sphinx_output}" MATCHES ".* ([0-9]+(\\.[0-9]+(\\.[0-9]+)?)?).*\n")
set(${_Sphinx_tool_version_var} "${CMAKE_MATCH_1}")
if(NOT DEFINED Sphinx_VERSION)
set(Sphinx_VERSION ${${_Sphinx_tool_version_var}})
endif()
endif()
unset(_Sphinx_output)
endif()
mark_as_advanced(${_Sphinx_tool_executable_var})
unset(_Sphinx_tool_version_var)
unset(_Sphinx_tool_executable_var)
unset(_Sphinx_tool_uppercase)
endforeach()
if(DEFINED Sphinx_BUILD_VERSION)
set(Sphinx_VERSION ${Sphinx_BUILD_VERSION})
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(
Sphinx
REQUIRED_VARS ${_Sphinx_required_vars}
VERSION_VAR Sphinx_VERSION)
unset(_Sphinx_required_vars)
# FindSphinx.cmake EOF
Morty Proxy This is a proxified and sanitized view of the page, visit original site.