1
1
#===============================================================================
2
- # Copyright 2021 Intel Corporation
2
+ # Copyright 2021-2024 Intel Corporation
3
3
#
4
4
# Licensed under the Apache License, Version 2.0 (the "License");
5
5
# you may not use this file except in compliance with the License.
@@ -22,9 +22,9 @@ if(Sphinx_cmake_included)
22
22
endif ()
23
23
set (Sphinx_cmake_included true )
24
24
25
- find_package (PythonInterp 2.7 )
25
+ find_package (Python 3.7 COMPONENTS Interpreter )
26
26
find_package (Sphinx)
27
- if (PYTHONINTERP_FOUND AND SPHINX_FOUND)
27
+ if (Python_FOUND AND SPHINX_FOUND)
28
28
set (SPHINX_GENERATOR "html" CACHE STRING "specifies generator for Sphinx" )
29
29
30
30
set (SPHINX_OUTPUT_DIR
@@ -52,12 +52,12 @@ if (PYTHONINTERP_FOUND AND SPHINX_FOUND)
52
52
COMMAND ${CMAKE_COMMAND} -E copy_directory
53
53
${CMAKE_CURRENT_SOURCE_DIR} /doc /sphinx/_static
54
54
${SPHINX_SOURCE_DIR} /_static
55
- COMMAND ${PYTHON_EXECUTABLE }
55
+ COMMAND ${Python_EXECUTABLE }
56
56
${CMAKE_CURRENT_BINARY_DIR} /cleanup.py ${SPHINX_SOURCE_DIR}
57
57
COMMAND ${SPHINX_EXECUTABLE} -b ${SPHINX_GENERATOR}
58
58
-D release=v${PROJECT_VERSION} -j auto rst ${SPHINX_OUTPUT_DIR}
59
59
COMMAND ${CMAKE_COMMAND} -E touch ${SPHINX_STAMP_FILE}
60
60
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} /reference
61
61
COMMENT "Generating API documentation with Sphinx" VERBATIM )
62
62
add_custom_target (doc_sphinx DEPENDS ${SPHINX_STAMP_FILE} doc_doxyrest)
63
- endif (PYTHONINTERP_FOUND AND SPHINX_FOUND)
63
+ endif (Python_FOUND AND SPHINX_FOUND)
0 commit comments