Back to home page

sPhenix code displayed by LXR

 
 

    


Warning, /acts/cmake/FindSphinx.cmake is written in an unsupported language. File is not indexed.

0001 # Find the Sphinx documentation generator.
0002 #
0003 # This module defines the following variables:
0004 #   Sphinx_FOUND - whether Sphinx was found or not
0005 #   Sphinx_EXECUTABLE - Sphinx executable if if was found
0006 #
0007 
0008 set(_hints)
0009 
0010 # use python installation to find potential install locations for sphinx
0011 find_package(Python3 QUIET)
0012 if(Python3_EXECUTABLE)
0013   execute_process(
0014     COMMAND ${Python3_EXECUTABLE} -m site --user-base
0015     OUTPUT_VARIABLE Python3_USER_BASE)
0016   execute_process(
0017     COMMAND ${Python3_EXECUTABLE} -c "import sys; print(sys.exec_prefix)"
0018     OUTPUT_VARIABLE Python3_EXEC_PREFIX)
0019   # strip newlines
0020   string(REPLACE "\n" "" Python3_USER_BASE ${Python3_USER_BASE})
0021   string(REPLACE "\n" "" Python3_EXEC_PREFIX ${Python3_EXEC_PREFIX})
0022   # add derived binary dirs as hints
0023   list(APPEND _hints "${Python3_USER_BASE}/bin" "${Python3_EXEC_PREFIX}/bin")
0024 endif()
0025 
0026 # find sphinx executable
0027 if(_hints)
0028   message(STATUS "Using additional Sphinx search hints:")
0029   foreach(_hint IN LISTS _hints)
0030     message(STATUS " ${_hint}")
0031   endforeach()
0032 endif()
0033 find_program(
0034   Sphinx_EXECUTABLE
0035   NAMES sphinx-build sphinx-build-3
0036   HINTS ${_hints}
0037   DOC "Sphinx documentation generator")
0038 
0039 include(FindPackageHandleStandardArgs)
0040 find_package_handle_standard_args(
0041   Sphinx
0042   REQUIRED_VARS Sphinx_EXECUTABLE)
0043 
0044 unset(_hints)