build: Actually search for Python 3 interpreter before using it.

This commit is contained in:
Ryan Pavlik 2020-10-13 16:36:33 -05:00
parent 0ea7cf8009
commit 69b35f9857

View file

@ -43,6 +43,17 @@ find_package(cJSON)
find_package(Systemd)
find_package(OpenGLES COMPONENTS V3)
if(NOT CMAKE_VERSION VERSION_LESS 3.12)
find_package(Python3 REQUIRED Interpreter)
set(PYTHON_EXECUTABLE Python3::Interpreter)
else()
find_package(PythonInterp REQUIRED VERSION 3)
if(PYTHON_EXECUTABLE MATCHES "WindowsApps")
# If you hit this error, you will have to install Python 3 or try harder to tell CMake where it is.
message(FATAL_ERROR "Found WindowsApps alias for Python. Make sure Python3 is installed, then choose 'Manage App Execution Aliases' in Start and disable the aliases for Python.")
endif()
endif()
add_library(xrt-pthreads INTERFACE)
if(WIN32)
find_package(pthreads_windows REQUIRED)