ENH: Move to requiring python 3

Resolves #1081

See for more details:
https://devguide.python.org/devcycle/#end-of-life-branches
https://pythonclock.org/
This commit is contained in:
Hans Johnson 2019-11-04 07:46:51 -06:00 committed by Christopher Dunn
parent 5fb17a66b8
commit a86e129983

View File

@ -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