From 80fbeb4fe5501f6be7c26efed1655a2f0ee60b6b Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 30 Nov 2019 21:14:12 +0100 Subject: [PATCH] Revert "cmake: Use standard way of getting python prefix" This reverts commit f6311abc8765fee1ed9b5fdf16af62452a3e083e. --- .../volk_gnsssdr/cmake/Modules/VolkPython.cmake | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkPython.cmake b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkPython.cmake index a597d42df..e3df8cd8d 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkPython.cmake +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkPython.cmake @@ -115,11 +115,15 @@ endif() # Sets the python installation directory VOLK_PYTHON_DIR ######################################################################## if(NOT DEFINED VOLK_PYTHON_DIR) - execute_process(COMMAND ${PYTHON_EXECUTABLE} -c " -from distutils import sysconfig -print(sysconfig.get_python_lib(plat_specific=True, prefix='')) +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')) " OUTPUT_VARIABLE VOLK_PYTHON_DIR OUTPUT_STRIP_TRAILING_WHITESPACE - ) +) endif() file(TO_CMAKE_PATH ${VOLK_PYTHON_DIR} VOLK_PYTHON_DIR)