From ac8bde5978201d76f029552231d279ef9fd6ae81 Mon Sep 17 00:00:00 2001 From: "Galantsev, Dmitrii" Date: Mon, 25 Sep 2023 01:53:42 -0500 Subject: [PATCH] CMAKE - Fix --break-system-packages Change-Id: I4a46859124018b6574d2b53e6ef9e72482784f39 Signed-off-by: Galantsev, Dmitrii --- py-interface/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/py-interface/CMakeLists.txt b/py-interface/CMakeLists.txt index dd0516c908..dc1d498103 100644 --- a/py-interface/CMakeLists.txt +++ b/py-interface/CMakeLists.txt @@ -47,9 +47,12 @@ else() find_package(Python3 3.7 COMPONENTS Interpreter Development REQUIRED) # --break-system-packages is needed for python 3.11 # see: https://peps.python.org/pep-0668/ + if (NOT Python3_VERSION VERSION_LESS "3.11") + set(Python3_BREAK_SYSTEM_PACKAGES "--break-system-packages") + endif() add_custom_target( python_pre_reqs - COMMAND ${Python3_EXECUTABLE} -m pip install --break-system-packages clang==${clang_ver} ctypeslib2==${ctypeslib_ver}) + COMMAND ${Python3_EXECUTABLE} -m pip install ${Python3_BREAK_SYSTEM_PACKAGES} clang==${clang_ver} ctypeslib2==${ctypeslib_ver}) # generate new wrapper configure_file(${PROJECT_SOURCE_DIR}/tools/generator.py generator.py @ONLY COPYONLY) add_custom_command(