Replace deprecated FindPythonInterp with FindPython3

fix #2755

https://cmake.org/cmake/help/v3.16/module/FindPythonInterp.html
This commit is contained in:
Eisuke Kawashima
2025-06-09 09:09:50 +09:00
committed by Chris Thrasher
parent ac207fc90f
commit 334827eb53
3 changed files with 12 additions and 13 deletions

View File

@@ -79,8 +79,8 @@ add_subdirectory(src)
# Build tests only if requested
if(BUILD_TESTING AND CATCH_BUILD_TESTING AND NOT_SUBPROJECT)
find_package(PythonInterp 3 REQUIRED)
if(NOT PYTHONINTERP_FOUND)
find_package(Python3 REQUIRED COMPONENTS Interpreter)
if(NOT TARGET Python3::Interpreter)
message(FATAL_ERROR "Python not found, but required for tests")
endif()
set(CMAKE_FOLDER "tests")