From 7857064706f62b87ad38eb847ff82a56696c7cf6 Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Thu, 1 Sep 2022 13:23:28 +0200 Subject: [PATCH 1/2] Fix Python 3.10 warning due to distutils deprecation --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index aa535591c..4d5151bc0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,7 +34,7 @@ include(RobotologySuperbuildOptions) # Python-related logic if(ROBOTOLOGY_USES_PYTHON) find_package(Python3 COMPONENTS Interpreter Development REQUIRED) - execute_process(COMMAND ${Python3_EXECUTABLE} -c "from distutils import sysconfig; print(sysconfig.get_python_lib(1,0,prefix=''))" + execute_process(COMMAND ${Python3_EXECUTABLE} -c "import sysconfig; print(sysconfig.get_python_lib(1,0,prefix=''))" OUTPUT_VARIABLE _PYTHON_INSTDIR) string(STRIP ${_PYTHON_INSTDIR} ROBOTOLOGY_SUPERBUILD_PYTHON_INSTALL_DIR) file(TO_CMAKE_PATH "${ROBOTOLOGY_SUPERBUILD_PYTHON_INSTALL_DIR}" ROBOTOLOGY_SUPERBUILD_PYTHON_INSTALL_DIR) From b7cdb915af50ab232e3b4cc399585504185e6e1c Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Thu, 1 Sep 2022 13:24:19 +0200 Subject: [PATCH 2/2] Update RobSupPurePythonYCMEPHelper.cmake --- cmake/RobSupPurePythonYCMEPHelper.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/RobSupPurePythonYCMEPHelper.cmake b/cmake/RobSupPurePythonYCMEPHelper.cmake index 36a3a1aff..8b7cef025 100644 --- a/cmake/RobSupPurePythonYCMEPHelper.cmake +++ b/cmake/RobSupPurePythonYCMEPHelper.cmake @@ -27,7 +27,7 @@ function(ROB_SUP_PURE_PYTHON_YCM_EP_HELPER _name) find_package(Python3 COMPONENTS Interpreter REQUIRED) execute_process(COMMAND ${Python3_EXECUTABLE} - -c "from distutils import sysconfig; print(sysconfig.get_python_lib(1,0,prefix=''))" + -c "import sysconfig; print(sysconfig.get_python_lib(1,0,prefix=''))" OUTPUT_VARIABLE _PYTHON_INSTDIR) string(STRIP ${_PYTHON_INSTDIR} ROBSUB_PYTHON_INSTALL_DIR)