1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-16 13:10:35 +00:00

Merge branch 'next' of https://github.com/gnss-sdr/gnss-sdr into next

This commit is contained in:
Carles Fernandez 2018-07-27 11:40:05 +02:00
commit 426a2c3462
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
2 changed files with 23 additions and 12 deletions

View File

@ -567,25 +567,31 @@ if(NOT VOLK_GNSSSDR_FOUND)
############################### ###############################
# Find Python required modules # Find Python required modules
############################### ###############################
include(SetupPython) #sets PYTHON_EXECUTABLE and PYTHON_DASH_B include(SetupPython) # sets PYTHON_EXECUTABLE and search for required modules
GNSSSDR_PYTHON_CHECK_MODULE("python >= ${GNSSSDR_PYTHON_MIN_VERSION}" sys "sys.version.split()[0] >= '${GNSSSDR_PYTHON_MIN_VERSION}'" PYTHON_MIN_VER_FOUND) GNSSSDR_PYTHON_CHECK_MODULE("python >= ${GNSSSDR_PYTHON_MIN_VERSION}" sys "sys.version.split()[0] >= '${GNSSSDR_PYTHON_MIN_VERSION}'" PYTHON_MIN_VER_FOUND)
GNSSSDR_PYTHON_CHECK_MODULE("mako >= ${GNSSSDR_MAKO_MIN_VERSION}" mako "mako.__version__ >= '${GNSSSDR_MAKO_MIN_VERSION}'" MAKO_FOUND) GNSSSDR_PYTHON_CHECK_MODULE("mako >= ${GNSSSDR_MAKO_MIN_VERSION}" mako "mako.__version__ >= '${GNSSSDR_MAKO_MIN_VERSION}'" MAKO_FOUND)
GNSSSDR_PYTHON_CHECK_MODULE("six - python 2 and 3 compatibility library" six "True" SIX_FOUND) GNSSSDR_PYTHON_CHECK_MODULE("six - python 2 and 3 compatibility library" six "True" SIX_FOUND)
if(NOT PYTHON_MIN_VER_FOUND) if(NOT PYTHON_MIN_VER_FOUND)
message(FATAL_ERROR "Python ${GNSSSDR_PYTHON_MIN_VERSION} or greater required to build VOLK_GNSSSDR") message(FATAL_ERROR "Python ${GNSSSDR_PYTHON_MIN_VERSION} or greater required to build VOLK_GNSSSDR")
endif() endif(NOT PYTHON_MIN_VER_FOUND)
if(${PYTHON3})
set(PYTHON_NAME "python3")
else(${PYTHON3})
set(PYTHON_NAME "python")
endif(${PYTHON3})
# Mako # Mako
if(NOT MAKO_FOUND) if(NOT MAKO_FOUND)
message(STATUS "Mako templates not found. See http://www.makotemplates.org/ ") message(STATUS "Mako template library not found. See http://www.makotemplates.org/ ")
message(STATUS " You can try to install it by typing:") message(STATUS " You can try to install it by typing:")
if(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") if(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat")
message(STATUS " sudo yum install python-mako") message(STATUS " sudo yum install ${PYTHON_NAME}-mako")
elseif(${LINUX_DISTRIBUTION} MATCHES "openSUSE") elseif(${LINUX_DISTRIBUTION} MATCHES "openSUSE")
message(STATUS " sudo zypper install python-Mako") message(STATUS " sudo zypper install ${PYTHON_NAME}-Mako")
else(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") else(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat")
message(STATUS " sudo apt-get install python-mako") message(STATUS " sudo apt-get install ${PYTHON_NAME}-mako")
endif(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") endif(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat")
message(FATAL_ERROR "Mako templates required to build VOLK_GNSSSDR") message(FATAL_ERROR "Mako templates required to build VOLK_GNSSSDR")
endif(NOT MAKO_FOUND) endif(NOT MAKO_FOUND)
@ -595,11 +601,11 @@ if(NOT VOLK_GNSSSDR_FOUND)
message(STATUS "python-six not found. See https://pythonhosted.org/six/ ") message(STATUS "python-six not found. See https://pythonhosted.org/six/ ")
message(STATUS " You can try to install it by typing:") message(STATUS " You can try to install it by typing:")
if(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") if(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat")
message(STATUS " sudo yum install python-six") message(STATUS " sudo yum install ${PYTHON_NAME}-six")
elseif(${LINUX_DISTRIBUTION} MATCHES "openSUSE") elseif(${LINUX_DISTRIBUTION} MATCHES "openSUSE")
message(STATUS " sudo zypper install python-six") message(STATUS " sudo zypper install ${PYTHON_NAME}-six")
else(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") else(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat")
message(STATUS " sudo apt-get install python-six") message(STATUS " sudo apt-get install ${PYTHON_NAME}-six")
endif(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") endif(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat")
message(FATAL_ERROR "six - python 2 and 3 compatibility library required to build VOLK_GNSSSDR") message(FATAL_ERROR "six - python 2 and 3 compatibility library required to build VOLK_GNSSSDR")
endif(NOT SIX_FOUND) endif(NOT SIX_FOUND)

View File

@ -24,13 +24,18 @@
if (PYTHON_EXECUTABLE) if (PYTHON_EXECUTABLE)
message(STATUS "User set python executable ${PYTHON_EXECUTABLE}") message(STATUS "User set python executable ${PYTHON_EXECUTABLE}")
find_package(PythonInterp ${GNSSSDR_PYTHON_MIN_VERSION} REQUIRED) string(FIND "${PYTHON_EXECUTABLE}" "python3" IS_PYTHON3)
if(IS_PYTHON3 EQUAL -1)
find_package(PythonInterp ${GNSSSDR_PYTHON_MIN_VERSION} REQUIRED)
else(IS_PYTHON3 EQUAL -1)
find_package(PythonInterp ${GNSSSDR_PYTHON3_MIN_VERSION} REQUIRED)
endif(IS_PYTHON3 EQUAL -1)
else (PYTHON_EXECUTABLE) else (PYTHON_EXECUTABLE)
message(STATUS "PYTHON_EXECUTABLE not set - using default python2") message(STATUS "PYTHON_EXECUTABLE not set - using default python2")
message(STATUS "Use -DPYTHON_EXECUTABLE=/path/to/python3 to build for python3.")
find_package(PythonInterp ${GNSSSDR_PYTHON_MIN_VERSION}) find_package(PythonInterp ${GNSSSDR_PYTHON_MIN_VERSION})
if(NOT PYTHONINTERP_FOUND) if(NOT PYTHONINTERP_FOUND)
# message(STATUS "Use -DPYTHON_EXECUTABLE=/path/to/python2 to build for python2.") message(STATUS "python2 not found - trying with python3")
message(STATUS "python2 not found - using python3")
find_package(PythonInterp ${GNSSSDR_PYTHON3_MIN_VERSION} REQUIRED) find_package(PythonInterp ${GNSSSDR_PYTHON3_MIN_VERSION} REQUIRED)
endif(NOT PYTHONINTERP_FOUND) endif(NOT PYTHONINTERP_FOUND)
endif (PYTHON_EXECUTABLE) endif (PYTHON_EXECUTABLE)