From 396ed0c8afeb948afe7dfa4b413a865b15a8b18a Mon Sep 17 00:00:00 2001 From: Steven Koo Date: Tue, 18 Jan 2022 21:40:39 -0600 Subject: fixup! cmake: Replace distutils.sysconfig with sysconfig The original commit incorrectly fails the build uhd in the meta-ettus context. This uses prefix instead to get the base path. Signed-off-by: Steven Koo --- mpm/python/CMakeLists.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'mpm/python') diff --git a/mpm/python/CMakeLists.txt b/mpm/python/CMakeLists.txt index 260d3bab7..51aced18d 100644 --- a/mpm/python/CMakeLists.txt +++ b/mpm/python/CMakeLists.txt @@ -31,7 +31,7 @@ PYTHON_CHECK_MODULE( PYTHON_CHECK_MODULE_VERSION( "pyudev module" - "pyudev" + "pyudev" "pyudev.__version__" ${PYUDEV_MIN_VERSION} HAVE_PYTHON_MODULE_PYUDEV @@ -41,7 +41,7 @@ PYTHON_CHECK_MODULE_VERSION( # attribute, so merely check for its presence. PYTHON_CHECK_MODULE( "pyroute2 module" - "pyroute2" + "pyroute2" "True" HAVE_PYTHON_MODULE_PYROUTE2 ) @@ -101,10 +101,10 @@ add_custom_command(OUTPUT ${OUTPUT} add_custom_target(usrp_mpm ALL DEPENDS ${OUTPUT} pyusrp_periphs) execute_process(COMMAND ${PYTHON_EXECUTABLE} -c - "import sysconfig;\ + "import os,sysconfig;\ platlib = sysconfig.get_path(name='platlib');\ - base = sysconfig.get_config_var('base');\ - print(platlib.replace(base, '').lstrip('/\\\\'))" + prefix = sysconfig.get_config_var('prefix');\ + print(os.path.relpath(platlib, prefix));" OUTPUT_VARIABLE USRP_MPM_PYTHON_DIR OUTPUT_STRIP_TRAILING_WHITESPACE ) install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/build/lib/usrp_mpm DESTINATION ${USRP_MPM_PYTHON_DIR}) -- cgit v1.2.3