Patrick Williams | 2a25492 | 2023-08-11 09:48:11 -0500 | [diff] [blame^] | 1 | From f99c3f1f516a84d33794f8e3da59adea1a12ef54 Mon Sep 17 00:00:00 2001 |
| 2 | From: Kai Kang <kai.kang@windriver.com> |
| 3 | Date: Tue, 20 Jun 2023 22:42:51 +0800 |
| 4 | Subject: [PATCH] CMakeLists.txt: make 2 variables configurable |
| 5 | |
| 6 | Variables PREFERRED_PYTHON_PATH and PYTHON3_PATH are set with |
| 7 | ${PYTHON_EXECUTABLE}. For cross compile, ${PYTHON_EXECUTABLE} may point |
| 8 | to other path rather than standard dir such as /usr/bin. Then the |
| 9 | generated library file contains such path which should NOT. Update to |
| 10 | make variables PREFERRED_PYTHON_PATH and PYTHON3_PATH configurable to |
| 11 | avoid such issue. |
| 12 | |
| 13 | Upstream-Status: Submitted [https://github.com/OpenSCAP/openscap/pull/1990] |
| 14 | |
| 15 | Signed-off-by: Kai Kang <kai.kang@windriver.com> |
| 16 | --- |
| 17 | CMakeLists.txt | 4 ++-- |
| 18 | 1 file changed, 2 insertions(+), 2 deletions(-) |
| 19 | |
| 20 | diff --git a/CMakeLists.txt b/CMakeLists.txt |
| 21 | index 5db014e77..74628cdd4 100644 |
| 22 | --- a/CMakeLists.txt |
| 23 | +++ b/CMakeLists.txt |
| 24 | @@ -125,8 +125,8 @@ endif() |
| 25 | find_package(PythonInterp 3) |
| 26 | find_package(PythonLibs 3) |
| 27 | |
| 28 | -set(PREFERRED_PYTHON_PATH "${PYTHON_EXECUTABLE}") |
| 29 | -set(PYTHON3_PATH "${PYTHON_EXECUTABLE}") |
| 30 | +set(PREFERRED_PYTHON_PATH "${PYTHON_EXECUTABLE}" CACHE PATH "Path to preferred Python") |
| 31 | +set(PYTHON3_PATH "${PYTHON_EXECUTABLE}" CACHE PATH "Path to Python3") |
| 32 | |
| 33 | find_package(RPM) |
| 34 | if(RPM_FOUND) |
| 35 | -- |
| 36 | 2.34.1 |
| 37 | |