Replace deprecated find_package(PythonInterp) with Python2/Python3

Fixes: #1751
This commit is contained in:
Azat Khuzhin 2024-11-24 23:32:04 +01:00 committed by Azat Khuzhin
parent cf5571132b
commit a2ed23b176

View File

@ -1245,14 +1245,16 @@ if (NOT EVENT__DISABLE_TESTS)
#
if (NOT EVENT__DISABLE_REGRESS)
# (We require python to generate the regress tests)
find_package(PythonInterp 3)
find_package(Python3 COMPONENTS Interpreter)
if (PYTHONINTERP_FOUND)
if (Python3_FOUND)
set(__FOUND_USABLE_PYTHON 1)
set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE})
else()
find_package(PythonInterp 2)
if (PYTHONINTERP_FOUND)
find_package(Python2 COMPONENTS Interpreter)
if (Python2_FOUND)
set(__FOUND_USABLE_PYTHON 1)
set(PYTHON_EXECUTABLE ${Python2_EXECUTABLE})
else()
message(ERROR "No suitable Python version found, bailing...")
endif()