Skip to content

Commit 50671dd

Browse files
committed
1 parent d76492c commit 50671dd

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Diff for: src/jsontestrunner/CMakeLists.txt

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
1-
find_package(PythonInterp 2.6)
1+
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.12.0)
2+
# The new Python3 module is much more robust than the previous PythonInterp
3+
find_package (Python3 COMPONENTS Interpreter)
4+
# Set variables for backwards compatibility with cmake < 3.12.0
5+
set(PYTHONINTERP_FOUND ${Python3_Interpreter_FOUND})
6+
set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE})
7+
else()
8+
set(Python_ADDITIONAL_VERSIONS 3.8)
9+
find_package(PythonInterp 3)
10+
endif()
211

312
add_executable(jsontestrunner_exe
413
main.cpp

0 commit comments

Comments
 (0)