1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2026-04-29 02:01:25 +00:00

Fix breaking change in CMake 3.27: PythonInterp was removed

This commit is contained in:
Carles Fernandez
2023-10-05 15:11:21 +02:00
parent 7d091afc26
commit b16c1de541
3 changed files with 14 additions and 6 deletions

View File

@@ -71,7 +71,9 @@ if(CMAKE_VERSION VERSION_LESS 3.12 OR CMAKE_CROSSCOMPILING)
else()
if(PYTHON_EXECUTABLE)
message(STATUS "User set python executable ${PYTHON_EXECUTABLE}")
find_package(PythonInterp ${VOLK_PYTHON_MIN_VERSION} REQUIRED)
if(CMAKE_VERSION VERSION_LESS "3.27")
find_package(PythonInterp ${VOLK_PYTHON_MIN_VERSION} REQUIRED)
endif()
volk_python_check_module("mako >= 0.4.2" mako "mako.__version__ >= '0.4.2'" MAKO_FOUND)
if(PYTHON_VERSION_STRING VERSION_LESS "3.0")
volk_python_check_module("six - python 2 and 3 compatibility library" six "True" SIX_FOUND)
@@ -102,15 +104,19 @@ else()
endif()
if(NOT MAKO_FOUND OR NOT SIX_FOUND)
unset(PYTHON_EXECUTABLE)
find_package(PythonInterp ${VOLK_PYTHON_MIN_VERSION})
if(CMAKE_VERSION VERSION_LESS "3.27")
find_package(PythonInterp ${VOLK_PYTHON_MIN_VERSION})
endif()
volk_python_check_module("mako >= 0.4.2" mako "mako.__version__ >= '0.4.2'" MAKO_FOUND)
endif()
endif()
endif()
endif()
if(${PYTHON_VERSION_MAJOR} VERSION_EQUAL 3)
set(PYTHON3 TRUE)
if(CMAKE_VERSION VERSION_LESS "3.27")
if(${PYTHON_VERSION_MAJOR} VERSION_EQUAL 3)
set(PYTHON3 TRUE)
endif()
endif()