From a86e129983d30fba3c9b1de77036b19cf6c6a7a8 Mon Sep 17 00:00:00 2001 From: Hans Johnson Date: Mon, 4 Nov 2019 07:46:51 -0600 Subject: [PATCH] ENH: Move to requiring python 3 Resolves #1081 See for more details: https://devguide.python.org/devcycle/#end-of-life-branches https://pythonclock.org/ --- src/jsontestrunner/CMakeLists.txt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/jsontestrunner/CMakeLists.txt b/src/jsontestrunner/CMakeLists.txt index 39c6f4871..210e0900b 100644 --- a/src/jsontestrunner/CMakeLists.txt +++ b/src/jsontestrunner/CMakeLists.txt @@ -1,4 +1,13 @@ -find_package(PythonInterp 2.6) +if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.12.0) + # The new Python3 module is much more robust than the previous PythonInterp + find_package (Python3 COMPONENTS Interpreter) + # Set variables for backwards compatibility with cmake < 3.12.0 + set(PYTHONINTERP_FOUND ${Python3_Interpreter_FOUND}) + set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE}) +else() + set(Python_ADDITIONAL_VERSIONS 3.8) + find_package(PythonInterp 3) +endif() add_executable(jsontestrunner_exe main.cpp