From d67ad46903a1772d538e0aade230b39105a584e9 Mon Sep 17 00:00:00 2001 From: Nick Brown Date: Thu, 16 Sep 2021 10:56:33 +0100 Subject: build: complete python3 support, no hardcode path find_package(Python3) will not set variables that are later used, so set those needed. Perhaps the python2 support, which is EOL, could be dropped? Use DESTDIR, instead of hardcoding the path. This allows system packaging, or local installs, to work properly. Type: make Signed-off-by: Nick Brown Change-Id: I045516c61473c612ab70858cd9b58c4e2838b347 --- src/vpp-api/python/CMakeLists.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/vpp-api/python/CMakeLists.txt b/src/vpp-api/python/CMakeLists.txt index 6450fd92f2d..789a72233e6 100644 --- a/src/vpp-api/python/CMakeLists.txt +++ b/src/vpp-api/python/CMakeLists.txt @@ -15,6 +15,8 @@ if (CMAKE_VERSION VERSION_LESS 3.12) find_package(PythonInterp 2.7) else() find_package(Python3 COMPONENTS Interpreter) + set(PYTHONINTERP_FOUND ${Python3_Interpreter_FOUND}) + set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE}) endif() if(PYTHONINTERP_FOUND) @@ -24,11 +26,10 @@ if(PYTHONINTERP_FOUND) WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMAND ${PYTHON_EXECUTABLE} ./setup.py install - --root / + --root=\$ENV{DESTDIR}/ --prefix=${CMAKE_INSTALL_PREFIX} --single-version-externally-managed bdist_egg - --dist-dir=${CMAKE_INSTALL_PREFIX} OUTPUT_QUIET )" COMPONENT vpp-api-python -- cgit 1.2.3-korg