From e48389e306bec09529eef964ad6f184f22b88d2a Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 26 Nov 2022 11:37:35 +0100 Subject: [PATCH] Fix installation of volk_gnsssdr python files if Python >= 3.10 --- .../volk_gnsssdr/cmake/Modules/VolkPython.cmake | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 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 977b6b95e..fcaabe4ff 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 @@ -112,7 +112,18 @@ endif() # Sets the python installation directory VOLK_PYTHON_DIR ######################################################################## if(NOT DEFINED VOLK_PYTHON_DIR) -execute_process(COMMAND ${PYTHON_EXECUTABLE} -c " + if(PYTHON_VERSION_STRING VERSION_GREATER "3.9.99") + execute_process(COMMAND ${PYTHON_EXECUTABLE} -c " +import os +import sys +if os.name == 'posix': + print(os.path.join('lib', 'python' + sys.version[:4], 'dist-packages')) +if os.name == 'nt': + print(os.path.join('Lib', 'site-packages')) +" OUTPUT_VARIABLE VOLK_PYTHON_DIR OUTPUT_STRIP_TRAILING_WHITESPACE + ) + else() + execute_process(COMMAND ${PYTHON_EXECUTABLE} -c " import os import sys if os.name == 'posix': @@ -120,7 +131,8 @@ if os.name == 'posix': if os.name == 'nt': print(os.path.join('Lib', 'site-packages')) " OUTPUT_VARIABLE VOLK_PYTHON_DIR OUTPUT_STRIP_TRAILING_WHITESPACE -) + ) + endif() endif() file(TO_CMAKE_PATH ${VOLK_PYTHON_DIR} VOLK_PYTHON_DIR)