summaryrefslogtreecommitdiffstats
path: root/src/vpp-api/python
diff options
context:
space:
mode:
authorNick Brown <nickbroon@gmail.com>2021-09-16 10:56:33 +0100
committerOle Tr�an <otroan@employees.org>2021-09-28 11:11:55 +0000
commitd67ad46903a1772d538e0aade230b39105a584e9 (patch)
treea529d7c79c65146a35f2e30bcef0a6a51a103d19 /src/vpp-api/python
parent850024bb846c193ada01f7237b3cfcd998e67d9c (diff)
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 <nickbroon@gmail.com> Change-Id: I045516c61473c612ab70858cd9b58c4e2838b347
Diffstat (limited to 'src/vpp-api/python')
-rw-r--r--src/vpp-api/python/CMakeLists.txt5
1 files changed, 3 insertions, 2 deletions
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