aboutsummaryrefslogtreecommitdiffstats
path: root/host/cmake/Modules/UHDPython.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'host/cmake/Modules/UHDPython.cmake')
-rw-r--r--host/cmake/Modules/UHDPython.cmake32
1 files changed, 2 insertions, 30 deletions
diff --git a/host/cmake/Modules/UHDPython.cmake b/host/cmake/Modules/UHDPython.cmake
index a93761131..d3fac6100 100644
--- a/host/cmake/Modules/UHDPython.cmake
+++ b/host/cmake/Modules/UHDPython.cmake
@@ -19,12 +19,9 @@ if(PYTHON_EXECUTABLE)
set(PYTHONINTERP_FOUND TRUE)
endif(PYTHON_EXECUTABLE)
-# We always try to find Py3k first. Once we only support Py3k we can remove
-# most of this.
if(NOT PYTHONINTERP_FOUND)
- find_package(Python3 ${PYTHON3_MIN_VERSION} QUIET)
+ find_package(Python3 ${PYTHON_MIN_VERSION} QUIET)
if(Python3_Interpreter_FOUND)
- set(PYTHON_MIN_VERSION ${PYTHON3_MIN_VERSION})
set(PYTHON_VERSION ${Python3_VERSION})
set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE})
set(PYTHONINTERP_FOUND TRUE)
@@ -32,43 +29,18 @@ if(NOT PYTHONINTERP_FOUND)
endif(NOT PYTHONINTERP_FOUND)
if(NOT PYTHONINTERP_FOUND)
- find_package(PythonInterp ${PYTHON3_MIN_VERSION} QUIET)
+ find_package(PythonInterp ${PYTHON_MIN_VERSION} QUIET)
if(PYTHONINTERP_FOUND)
- set(PYTHON_MIN_VERSION ${PYTHON3_MIN_VERSION})
set(PYTHON_VERSION ${PYTHON_VERSION_STRING})
endif(PYTHONINTERP_FOUND)
endif(NOT PYTHONINTERP_FOUND)
-# Next, try and find Py2k.
-if(NOT PYTHONINTERP_FOUND)
- find_package(Python2 ${PYTHON_MIN_VERSION} QUIET)
- if(Python2_Interpreter_FOUND)
- set(PYTHON_VERSION ${Python2_VERSION})
- set(PYTHON_EXECUTABLE ${Python2_EXECUTABLE})
- set(PYTHONINTERP_FOUND TRUE)
- endif(Python2_Interpreter_FOUND)
-endif(NOT PYTHONINTERP_FOUND)
-
-if(NOT PYTHONINTERP_FOUND)
- find_package(PythonInterp ${PYTHON_MIN_VERSION} QUIET)
- set(PYTHON_VERSION ${PYTHON_VERSION_STRING})
-endif(NOT PYTHONINTERP_FOUND)
-
# If that fails, try using the build-in find program routine.
if(NOT PYTHONINTERP_FOUND)
message(STATUS "Attempting to find Python without CMake...")
find_program(PYTHON_EXECUTABLE NAMES python3 python3.5 python3.6 python3.7 python3.8)
if(PYTHON_EXECUTABLE)
set(PYTHONINTERP_FOUND TRUE)
- set(PYTHON_MIN_VERSION ${PYTHON3_MIN_VERSION})
- endif(PYTHON_EXECUTABLE)
-endif(NOT PYTHONINTERP_FOUND)
-
-if(NOT PYTHONINTERP_FOUND)
- message(STATUS "Attempting to find Python without CMake...")
- find_program(PYTHON_EXECUTABLE NAMES python2 python2.7)
- if(PYTHON_EXECUTABLE)
- set(PYTHONINTERP_FOUND TRUE)
endif(PYTHON_EXECUTABLE)
endif(NOT PYTHONINTERP_FOUND)