1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-14 12:10:34 +00:00

Improve Python detection

This commit is contained in:
Carles Fernandez 2019-03-10 13:53:51 +01:00
parent 062f724c9f
commit b10aaafb86
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D

View File

@ -41,15 +41,23 @@ if(CMAKE_VERSION VERSION_LESS 3.12)
find_package(PythonInterp ${VOLK_PYTHON3_MIN_VERSION} REQUIRED)
endif()
endif()
find_package(PythonLibs ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR} EXACT)
else()
if(PYTHON_EXECUTABLE)
message(STATUS "User set python executable ${PYTHON_EXECUTABLE}")
find_package(PythonInterp ${VOLK_PYTHON_MIN_VERSION} REQUIRED)
else()
find_package(Python COMPONENTS Interpreter)
set(PYTHON_VERSION_MAJOR ${Python_VERSION_MAJOR})
set(PYTHON_EXECUTABLE ${Python_EXECUTABLE})
find_package(Python3 COMPONENTS Interpreter)
if(Python3_FOUND)
set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE})
set(PYTHON_VERSION_MAJOR ${Python3_VERSION_MAJOR})
endif()
if(NOT Python3_FOUND OR NOT MAKO_FOUND OR NOT SIX_FOUND)
find_package(Python2 COMPONENTS Interpreter)
if(Python2_FOUND)
set(PYTHON_EXECUTABLE ${Python2_EXECUTABLE})
set(PYTHON_VERSION_MAJOR ${Python2_VERSION_MAJOR})
endif()
endif()
endif()
endif()