aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorSteven Koo <steven.koo@ni.com>2022-01-18 21:40:39 -0600
committerAaron Rossetto <aaron.rossetto@ni.com>2022-01-20 08:31:50 -0600
commit396ed0c8afeb948afe7dfa4b413a865b15a8b18a (patch)
tree583ce9262fb82e6f4327d7a47760e7869d6273a7 /tools
parent2c7ce2dbf72414b64f8a477be614e23bc12f086d (diff)
downloaduhd-396ed0c8afeb948afe7dfa4b413a865b15a8b18a.tar.gz
uhd-396ed0c8afeb948afe7dfa4b413a865b15a8b18a.tar.bz2
uhd-396ed0c8afeb948afe7dfa4b413a865b15a8b18a.zip
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 <steven.koo@ni.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/gr-usrptest/cmake/Modules/GrPython.cmake14
1 files changed, 7 insertions, 7 deletions
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)