Skip to content

Commit b460af4

Browse files
committed
Sphinx find-module update.
1 parent f9d1042 commit b460af4

File tree

1 file changed

+15
-18
lines changed

1 file changed

+15
-18
lines changed

CMake/FindSphinx.cmake

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# FindSphinx.cmake
2-
# Copyright (C) 2021-2024 Manuel Sainz de Baranda y Goñi.
2+
# Copyright (C) 2021-2026 Manuel Sainz de Baranda y Goñi.
33
# This "find module" is distributed as public domain software.
44

55
#[=======================================================================[.rst:
@@ -74,31 +74,28 @@ foreach(_Sphinx_tool IN LISTS Sphinx_FIND_COMPONENTS)
7474
list( APPEND _Sphinx_required_vars
7575
${_Sphinx_tool_executable_var} ${_Sphinx_tool_version_var})
7676

77-
if(NOT DEFINED ${_Sphinx_tool_executable_var})
78-
find_program(
79-
${_Sphinx_tool_executable_var}
80-
NAMES sphinx-${_Sphinx_tool}
81-
DOC "`sphinx-${_Sphinx_tool}` executable.")
77+
find_program(
78+
${_Sphinx_tool_executable_var}
79+
NAMES sphinx-${_Sphinx_tool}
80+
DOC "`sphinx-${_Sphinx_tool}` executable.")
8281

83-
if(${_Sphinx_tool_executable_var})
84-
execute_process(
85-
COMMAND "${${_Sphinx_tool_executable_var}}" --version
86-
OUTPUT_VARIABLE _Sphinx_output)
82+
if(${_Sphinx_tool_executable_var})
83+
execute_process(
84+
COMMAND "${${_Sphinx_tool_executable_var}}" --version
85+
OUTPUT_VARIABLE _Sphinx_output)
8786

88-
if("${_Sphinx_output}" MATCHES ".* ([0-9]+(\\.[0-9]+(\\.[0-9]+)?)?).*\n")
89-
set(${_Sphinx_tool_version_var} "${CMAKE_MATCH_1}")
87+
if("${_Sphinx_output}" MATCHES ".* ([0-9]+(\\.[0-9]+(\\.[0-9]+)?)?).*\n")
88+
set(${_Sphinx_tool_version_var} "${CMAKE_MATCH_1}")
9089

91-
if(NOT DEFINED Sphinx_VERSION)
92-
set(Sphinx_VERSION ${${_Sphinx_tool_version_var}})
93-
endif()
90+
if(NOT DEFINED Sphinx_VERSION)
91+
set(Sphinx_VERSION ${${_Sphinx_tool_version_var}})
9492
endif()
95-
96-
unset(_Sphinx_output)
9793
endif()
9894

99-
mark_as_advanced(${_Sphinx_tool_executable_var})
95+
unset(_Sphinx_output)
10096
endif()
10197

98+
mark_as_advanced(${_Sphinx_tool_executable_var})
10299
unset(_Sphinx_tool_version_var)
103100
unset(_Sphinx_tool_executable_var)
104101
unset(_Sphinx_tool_uppercase)

0 commit comments

Comments
 (0)