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 --- tools/gr-usrptest/cmake/Modules/GrPython.cmake | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'tools/gr-usrptest/cmake') diff --git a/tools/gr-usrptest/cmake/Modules/GrPython.cmake b/tools/gr-usrptest/cmake/Modules/GrPython.cmake index fdd1aff61..22ac29d38 100644 --- a/tools/gr-usrptest/cmake/Modules/GrPython.cmake +++ b/tools/gr-usrptest/cmake/Modules/GrPython.cmake @@ -104,13 +104,13 @@ endmacro(GR_PYTHON_CHECK_MODULE) # Sets the python installation directory GR_PYTHON_DIR ######################################################################## if(NOT DEFINED GR_PYTHON_DIR) -execute_process(COMMAND ${PYTHON_EXECUTABLE} -c " -import sysconfig -platlib = sysconfig.get_path(name='platlib') -base = sysconfig.get_config_var('base') -print(platlib.replace(base, '').lstrip('/\\\\')) -" OUTPUT_VARIABLE GR_PYTHON_DIR OUTPUT_STRIP_TRAILING_WHITESPACE -) + execute_process(COMMAND ${PYTHON_EXECUTABLE} -c + "import os,sysconfig;\ + platlib = sysconfig.get_path(name='platlib');\ + prefix = sysconfig.get_config_var('prefix');\ + print(os.path.relpath(platlib, prefix));" + OUTPUT_VARIABLE GR_PYTHON_DIR OUTPUT_STRIP_TRAILING_WHITESPACE + ) endif() file(TO_CMAKE_PATH ${GR_PYTHON_DIR} GR_PYTHON_DIR) -- cgit v1.2.3