Commit 826e9f25 by Marius Brehler

Refactor finding python

Use `find_package(Python ..)` if available, instead of the deprecated `find_package(PythonInterp)` CMake module.
parent 035de8c7
...@@ -244,7 +244,13 @@ function(cxx_executable name dir libs) ...@@ -244,7 +244,13 @@ function(cxx_executable name dir libs)
endfunction() endfunction()
# Sets PYTHONINTERP_FOUND and PYTHON_EXECUTABLE. # Sets PYTHONINTERP_FOUND and PYTHON_EXECUTABLE.
find_package(PythonInterp) if ("${CMAKE_VERSION}" VERSION_LESS "3.12.0")
find_package(PythonInterp)
else()
find_package(Python COMPONENTS Interpreter)
set(PYTHONINTERP_FOUND ${Python_Interpreter_FOUND})
set(PYTHON_EXECUTABLE ${Python_EXECUTABLE})
endif()
# cxx_test_with_flags(name cxx_flags libs srcs...) # cxx_test_with_flags(name cxx_flags libs srcs...)
# #
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment