From 1cada9ad78fa8d1b6e6d812e0e407cde7f05d262 Mon Sep 17 00:00:00 2001 From: Damjan Marion Date: Mon, 6 Mar 2023 18:29:26 +0000 Subject: build: make Python3 mandatory Type: refactor Change-Id: Iac27ac4d11745b68c57a0394ced51942db8f0431 Signed-off-by: Damjan Marion --- src/vpp-api/python/CMakeLists.txt | 40 +++++++++++++++++---------------------- 1 file changed, 17 insertions(+), 23 deletions(-) diff --git a/src/vpp-api/python/CMakeLists.txt b/src/vpp-api/python/CMakeLists.txt index 789a72233e6..3059619ff21 100644 --- a/src/vpp-api/python/CMakeLists.txt +++ b/src/vpp-api/python/CMakeLists.txt @@ -11,27 +11,21 @@ # See the License for the specific language governing permissions and # limitations under the License. -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() +find_package(Python3 REQUIRED COMPONENTS Interpreter) +set(PYTHONINTERP_FOUND ${Python3_Interpreter_FOUND}) +set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE}) -if(PYTHONINTERP_FOUND) - install( - CODE " - execute_process( - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - COMMAND ${PYTHON_EXECUTABLE} ./setup.py - install - --root=\$ENV{DESTDIR}/ - --prefix=${CMAKE_INSTALL_PREFIX} - --single-version-externally-managed - bdist_egg - OUTPUT_QUIET - )" - COMPONENT vpp-api-python - ) -endif() +install( + CODE " + execute_process( + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + COMMAND ${PYTHON_EXECUTABLE} ./setup.py + install + --root=\$ENV{DESTDIR}/ + --prefix=${CMAKE_INSTALL_PREFIX} + --single-version-externally-managed + bdist_egg + OUTPUT_QUIET + )" + COMPONENT vpp-api-python +) -- cgit 1.2.3-korg