mirror of
https://github.com/libevent/libevent.git
synced 2025-01-09 00:56:20 +08:00
Replace deprecated find_package(PythonInterp) with Python2/Python3
Fixes: #1751
This commit is contained in:
parent
cf5571132b
commit
a2ed23b176
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user