From 1b15cc6e65c18cda7888a2eef1f55bf0a660ae7e Mon Sep 17 00:00:00 2001 From: Martin Kelly Date: Thu, 2 Apr 2020 13:56:32 -0700 Subject: cmake: fix Python executable with cmake Currently, CMake has two ways of finding Python executables: FindPythonInterp and FindPython/FindPython3. FindPythonInterp is deprecated and may be removed at some point. Currently, python3native sets PYTHON_EXECUTABLE, which FindPythonInterp uses. This is a problem for a few reasons: - Setting PYTHON_EXECUTABLE as an environment variable doesn't work, as CMake needs it to be set as an explicit CMake option via -D. - Projects using the newer FindPython/FindPython3 don't pickup the right Python, as the newer routines use Python_EXECUTABLE and Python3_EXECUTABLE. Fix this by setting PYTHON_EXECUTABLE, Python_EXECUTABLE, and Python3_EXECUTABLE using -D options to EXTRA_OECMAKE. The CMake routines are documented below: https://cmake.org/cmake/help/latest/module/FindPythonInterp.html https://cmake.org/cmake/help/latest/module/FindPython.html https://cmake.org/cmake/help/latest/module/FindPython3.html (From OE-Core rev: a22200a646eaf42cd4902a2fe3358d29717ac129) Signed-off-by: Martin Kelly Signed-off-by: Richard Purdie --- meta/classes/python3native.bbclass | 2 -- 1 file changed, 2 deletions(-) (limited to 'meta/classes/python3native.bbclass') diff --git a/meta/classes/python3native.bbclass b/meta/classes/python3native.bbclass index 182c11aa2e..d98fb4c758 100644 --- a/meta/classes/python3native.bbclass +++ b/meta/classes/python3native.bbclass @@ -1,8 +1,6 @@ inherit python3-dir PYTHON="${STAGING_BINDIR_NATIVE}/python3-native/python3" -# PYTHON_EXECUTABLE is used by cmake -PYTHON_EXECUTABLE="${PYTHON}" EXTRANATIVEPATH += "python3-native" DEPENDS_append = " python3-native " -- cgit v1.2.3-54-g00ecf