1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-10-31 23:26:22 +00:00

More fixes for CMake 3.27

This commit is contained in:
Carles Fernandez 2023-10-05 17:25:06 +02:00
parent 9b5739603a
commit 0da7fc6704
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
2 changed files with 28 additions and 4 deletions

View File

@ -60,10 +60,22 @@ if(CMAKE_VERSION VERSION_LESS 3.12 OR CMAKE_CROSSCOMPILING)
else() else()
message(STATUS "PYTHON_EXECUTABLE not set - trying by default python3") message(STATUS "PYTHON_EXECUTABLE not set - trying by default python3")
set(Python_ADDITIONAL_VERSIONS 3.4 3.5 3.6 3.7 3.8 3.9) set(Python_ADDITIONAL_VERSIONS 3.4 3.5 3.6 3.7 3.8 3.9)
find_package(PythonInterp ${GNSSSDR_PYTHON_MIN3_VERSION}) if(CMAKE_VERSION VERSION_LESS "3.27")
find_package(PythonInterp ${VOLK_PYTHON_MIN_VERSION})
else()
find_package(Python COMPONENTS Interpreter)
set(PYTHONINTERP_FOUND Python_Interpreter_FOUND)
set(PYTHON_VERSION_STRING "${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}")
endif()
if(NOT PYTHONINTERP_FOUND) if(NOT PYTHONINTERP_FOUND)
message(STATUS "python3 not found - trying with python2.7") message(STATUS "python3 not found - trying with python2.7")
find_package(PythonInterp ${GNSSSDR_PYTHON_MIN_VERSION} REQUIRED) if(CMAKE_VERSION VERSION_LESS "3.27")
find_package(PythonInterp ${VOLK_PYTHON_MIN_VERSION})
else()
find_package(Python2 COMPONENTS Interpreter)
set(PYTHONINTERP_FOUND Python2_Interpreter_FOUND)
set(PYTHON_VERSION_STRING "${Python2_VERSION_MAJOR}.${Python2_VERSION_MINOR}")
endif()
endif() endif()
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)
@ -97,8 +109,12 @@ else()
endif() endif()
if(NOT MAKO_FOUND OR NOT SIX_FOUND) if(NOT MAKO_FOUND OR NOT SIX_FOUND)
unset(PYTHON_EXECUTABLE) unset(PYTHON_EXECUTABLE)
if(CMAKE_VERSION VERSION_LESS 3.27) if(CMAKE_VERSION VERSION_LESS "3.27")
find_package(PythonInterp ${GNSSSDR_PYTHON_MIN_VERSION}) find_package(PythonInterp ${VOLK_PYTHON_MIN_VERSION})
else()
find_package(Python COMPONENTS Interpreter)
set(PYTHONINTERP_FOUND Python_Interpreter_FOUND)
set(PYTHON_VERSION_STRING "${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}")
endif() endif()
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)

View File

@ -73,6 +73,10 @@ else()
message(STATUS "User set python executable ${PYTHON_EXECUTABLE}") message(STATUS "User set python executable ${PYTHON_EXECUTABLE}")
if(CMAKE_VERSION VERSION_LESS "3.27") if(CMAKE_VERSION VERSION_LESS "3.27")
find_package(PythonInterp ${VOLK_PYTHON_MIN_VERSION} REQUIRED) find_package(PythonInterp ${VOLK_PYTHON_MIN_VERSION} REQUIRED)
else()
find_package(Python COMPONENTS Interpreter)
set(PYTHONINTERP_FOUND Python_Interpreter_FOUND)
set(PYTHON_VERSION_STRING "${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}")
endif() endif()
volk_python_check_module("mako >= 0.4.2" mako "mako.__version__ >= '0.4.2'" MAKO_FOUND) volk_python_check_module("mako >= 0.4.2" mako "mako.__version__ >= '0.4.2'" MAKO_FOUND)
if(PYTHON_VERSION_STRING VERSION_LESS "3.0") if(PYTHON_VERSION_STRING VERSION_LESS "3.0")
@ -106,6 +110,10 @@ else()
unset(PYTHON_EXECUTABLE) unset(PYTHON_EXECUTABLE)
if(CMAKE_VERSION VERSION_LESS "3.27") if(CMAKE_VERSION VERSION_LESS "3.27")
find_package(PythonInterp ${VOLK_PYTHON_MIN_VERSION}) find_package(PythonInterp ${VOLK_PYTHON_MIN_VERSION})
else()
find_package(Python COMPONENTS Interpreter)
set(PYTHONINTERP_FOUND Python_Interpreter_FOUND)
set(PYTHON_VERSION_STRING "${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}")
endif() endif()
volk_python_check_module("mako >= 0.4.2" mako "mako.__version__ >= '0.4.2'" MAKO_FOUND) volk_python_check_module("mako >= 0.4.2" mako "mako.__version__ >= '0.4.2'" MAKO_FOUND)
endif() endif()