From a2ed23b176634a8bc2e0385d79aa1f3a8684e5c5 Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Sun, 24 Nov 2024 23:32:04 +0100 Subject: [PATCH] Replace deprecated find_package(PythonInterp) with Python2/Python3 Fixes: #1751 --- CMakeLists.txt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 16c126be..9bcb1597 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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()