Back to home page

EIC 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     )
0017     execute_process(
0018         COMMAND ${Python3_EXECUTABLE} -c "import sys; print(sys.exec_prefix)"
0019         OUTPUT_VARIABLE Python3_EXEC_PREFIX
0020     )
0021     # strip newlines
0022     string(REPLACE "\n" "" Python3_USER_BASE ${Python3_USER_BASE})
0023     string(REPLACE "\n" "" Python3_EXEC_PREFIX ${Python3_EXEC_PREFIX})
0024     # add derived binary dirs as hints
0025     list(APPEND _hints "${Python3_USER_BASE}/bin" "${Python3_EXEC_PREFIX}/bin")
0026 endif()
0027 
0028 # find sphinx executable
0029 if(_hints)
0030     message(STATUS "Using additional Sphinx search hints:")
0031     foreach(_hint IN LISTS _hints)
0032         message(STATUS " ${_hint}")
0033     endforeach()
0034 endif()
0035 find_program(
0036     Sphinx_EXECUTABLE
0037     NAMES sphinx-build sphinx-build-3
0038     HINTS ${_hints}
0039     DOC "Sphinx documentation generator"
0040 )
0041 
0042 include(FindPackageHandleStandardArgs)
0043 find_package_handle_standard_args(Sphinx REQUIRED_VARS Sphinx_EXECUTABLE)
0044 
0045 unset(_hints)