1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-01-18 21:23:02 +00:00

Fix installation of volk_gnsssdr python files if Python >= 3.10

This commit is contained in:
Carles Fernandez 2022-11-26 11:37:35 +01:00
parent f71b7c9a67
commit e48389e306
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D

View File

@ -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)