From 2fcce7380f08fad53fed4a75cbb488836d337ee4 Mon Sep 17 00:00:00 2001 From: Christoph Haag Date: Wed, 3 Feb 2021 00:19:15 +0100 Subject: [PATCH] build/cmake: Don't use PythonInterp on old cmake It literally does not work to find python 3. https://cmake.org/cmake/help/latest/module/FindPythonInterp.html > Note > A call to find_package(PythonInterp ${V}) for python version V may find a python executable > with no version suffix. In this case no attempt is made to avoid python executables from other > versions. Use FindPython3, FindPython2 or FindPython instead. Fixes build on Ubuntu 18.04 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e639db3fc..5965db999 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -49,7 +49,7 @@ 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) + find_program(PYTHON_EXECUTABLE python3) 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.")