Skip to content

Commit

Permalink
CMake find modules update.
Browse files Browse the repository at this point in the history
  • Loading branch information
redcode committed Nov 5, 2024
1 parent 640857f commit 7229451
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CMake/FindBreathe.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ endif()

find_package_handle_standard_args(
Breathe
REQUIRED_VARS Breathe_APIDOC_EXECUTABLE
REQUIRED_VARS Breathe_APIDOC_EXECUTABLE Breathe_APIDOC_VERSION
VERSION_VAR Breathe_VERSION)

mark_as_advanced(Breathe_APIDOC_EXECUTABLE)
Expand Down
13 changes: 9 additions & 4 deletions CMake/FindSphinx.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ foreach(_Sphinx_tool IN LISTS Sphinx_FIND_COMPONENTS)

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})

if(NOT DEFINED ${_Sphinx_tool_executable_var})
find_program(
Expand All @@ -82,19 +86,20 @@ foreach(_Sphinx_tool IN LISTS Sphinx_FIND_COMPONENTS)
OUTPUT_VARIABLE _Sphinx_output)

if("${_Sphinx_output}" MATCHES ".* ([0-9]+(\\.[0-9]+(\\.[0-9]+)?)?).*\n")
list(APPEND _Sphinx_required_vars ${_Sphinx_tool_executable_var})
mark_as_advanced(${_Sphinx_tool_executable_var})
set(Sphinx_${_Sphinx_tool_uppercase}_VERSION "${CMAKE_MATCH_1}")
set(${_Sphinx_tool_version_var} "${CMAKE_MATCH_1}")

if(NOT DEFINED Sphinx_VERSION)
set(Sphinx_VERSION ${Sphinx_${_Sphinx_tool_uppercase}_VERSION})
set(Sphinx_VERSION ${${_Sphinx_tool_version_var}})
endif()
endif()

unset(_Sphinx_output)
endif()

mark_as_advanced(${_Sphinx_tool_executable_var})
endif()

unset(_Sphinx_tool_version_var)
unset(_Sphinx_tool_executable_var)
unset(_Sphinx_tool_uppercase)
endforeach()
Expand Down
2 changes: 1 addition & 1 deletion CMake/FindZeta.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ endif()
find_package_handle_standard_args(
Zeta
FOUND_VAR Zeta_FOUND
REQUIRED_VARS Zeta_INCLUDE_DIR
REQUIRED_VARS Zeta_INCLUDE_DIR Zeta_VERSION
VERSION_VAR Zeta_VERSION)

if(Zeta_FOUND AND NOT TARGET Zeta)
Expand Down

0 comments on commit 7229451

Please sign in to comment.