Skip to content

Commit 8f6a1fb

Browse files
committed
build: switched from FindPythonInterp to FindPython2
FindPythonInterp was deprecated in CMake 3.12 and removed in CMake 3.27.
1 parent 05a501c commit 8f6a1fb

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

CMakeLists.txt

+12-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#===============================================================================
2-
# Copyright 2016-2019 Intel Corporation
2+
# Copyright 2016-2024 Intel Corporation
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
@@ -16,11 +16,21 @@
1616

1717
cmake_minimum_required(VERSION 3.13)
1818

19-
# Install rules order
19+
# CMake minimum required version enables all policies introduced in minimum
20+
# version and earlier versions. Policies introduced in future versions
21+
# are handled individually in the section below.
22+
23+
# CMake 3.14: Install rules from add_subdirectory() calls are interleaved
24+
# with those in caller.
2025
if(POLICY CMP0082)
2126
cmake_policy(SET CMP0082 NEW)
2227
endif()
2328

29+
# CMake 3.27: The FindPythonInterp and FindPythonLibs modules are removed.
30+
if(POLICY CMP0148)
31+
cmake_policy(SET CMP0148 NEW)
32+
endif()
33+
2434
if("${CMAKE_BUILD_TYPE}" STREQUAL "")
2535
message(STATUS "CMAKE_BUILD_TYPE is unset, defaulting to Release")
2636
set(CMAKE_BUILD_TYPE "Release" CACHE STRING

cmake/Sphinx.cmake

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#===============================================================================
2-
# Copyright 2021 Intel Corporation
2+
# Copyright 2021-2024 Intel Corporation
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
@@ -22,9 +22,9 @@ if(Sphinx_cmake_included)
2222
endif()
2323
set(Sphinx_cmake_included true)
2424

25-
find_package(PythonInterp 2.7)
25+
find_package(Python 3.7 COMPONENTS Interpreter)
2626
find_package(Sphinx)
27-
if (PYTHONINTERP_FOUND AND SPHINX_FOUND)
27+
if (Python_FOUND AND SPHINX_FOUND)
2828
set(SPHINX_GENERATOR "html" CACHE STRING "specifies generator for Sphinx")
2929

3030
set(SPHINX_OUTPUT_DIR
@@ -52,12 +52,12 @@ if (PYTHONINTERP_FOUND AND SPHINX_FOUND)
5252
COMMAND ${CMAKE_COMMAND} -E copy_directory
5353
${CMAKE_CURRENT_SOURCE_DIR}/doc/sphinx/_static
5454
${SPHINX_SOURCE_DIR}/_static
55-
COMMAND ${PYTHON_EXECUTABLE}
55+
COMMAND ${Python_EXECUTABLE}
5656
${CMAKE_CURRENT_BINARY_DIR}/cleanup.py ${SPHINX_SOURCE_DIR}
5757
COMMAND ${SPHINX_EXECUTABLE} -b ${SPHINX_GENERATOR}
5858
-D release=v${PROJECT_VERSION} -j auto rst ${SPHINX_OUTPUT_DIR}
5959
COMMAND ${CMAKE_COMMAND} -E touch ${SPHINX_STAMP_FILE}
6060
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/reference
6161
COMMENT "Generating API documentation with Sphinx" VERBATIM)
6262
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

Comments
 (0)