From: Nick Brown Date: Thu, 16 Sep 2021 09:56:33 +0000 (+0100) Subject: build: complete python3 support, no hardcode path X-Git-Tag: v22.06-rc0~496 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=d67ad46903a1772d538e0aade230b39105a584e9;p=vpp.git 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 --- 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