summaryrefslogtreecommitdiff
path: root/cmake/Modules
diff options
context:
space:
mode:
authorSylvain Munaut <tnt@246tNt.com>2019-11-30 15:16:30 +0100
committerMartin Braun <martin.braun@ettus.com>2020-01-01 19:42:14 -0800
commit00822e3808509a98f4f8c59736aeb89cec0d7bbb (patch)
tree25823ac79274204addef08e91368a337d3f61fef /cmake/Modules
parent183a35ee554fd2034acbc5ac91e32abd046d5de1 (diff)
cmake: Use standard way of getting python prefix
Fixes #2006 This is exactly the same logic as is used in volk. Also the same logic used for the GR_PYTHON_RELATIVE just below ... so if it works for those on all OSes/config, no reasons it won't work here. Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Diffstat (limited to 'cmake/Modules')
-rw-r--r--cmake/Modules/GrPython.cmake8
1 files changed, 2 insertions, 6 deletions
diff --git a/cmake/Modules/GrPython.cmake b/cmake/Modules/GrPython.cmake
index ff8264a9b9..fd9b7583a4 100644
--- a/cmake/Modules/GrPython.cmake
+++ b/cmake/Modules/GrPython.cmake
@@ -109,12 +109,8 @@ endmacro(GR_PYTHON_CHECK_MODULE)
########################################################################
if(NOT DEFINED GR_PYTHON_DIR)
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "
-import os
-import sys
-if os.name == 'posix':
- print(os.path.join('lib', 'python' + sys.version[:3], 'dist-packages'))
-if os.name == 'nt':
- print(os.path.join('Lib', 'site-packages'))
+from distutils import sysconfig
+print(sysconfig.get_python_lib(plat_specific=True, prefix=''))
" OUTPUT_VARIABLE GR_PYTHON_DIR OUTPUT_STRIP_TRAILING_WHITESPACE
)
endif()