diff options
Diffstat (limited to 'host/cmake')
-rw-r--r-- | host/cmake/Modules/UHDPython.cmake | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/host/cmake/Modules/UHDPython.cmake b/host/cmake/Modules/UHDPython.cmake index ee78f914c..f8f3686c8 100644 --- a/host/cmake/Modules/UHDPython.cmake +++ b/host/cmake/Modules/UHDPython.cmake @@ -22,11 +22,20 @@ IF(PYTHON_EXECUTABLE) ELSE(PYTHON_EXECUTABLE) #use the built-in find script - FIND_PACKAGE(PythonInterp) + IF(ENABLE_PYTHON3) + FIND_PACKAGE(PythonInterp 3.0) + ELSE(ENABLE_PYTHON3) + FIND_PACKAGE(PythonInterp 2.0) + ENDIF(ENABLE_PYTHON3) #and if that fails use the find program routine IF(NOT PYTHONINTERP_FOUND) - FIND_PROGRAM(PYTHON_EXECUTABLE NAMES python python2.7) + IF(ENABLE_PYTHON3) + FIND_PROGRAM(PYTHON_EXECUTABLE NAMES python3 python3.5 python3.6) + ELSE(ENABLE_PYTHON3) + FIND_PROGRAM(PYTHON_EXECUTABLE NAMES python2 python2.7) + ENDIF(ENABLE_PYTHON3) + IF(PYTHON_EXECUTABLE) SET(PYTHONINTERP_FOUND TRUE) ENDIF(PYTHON_EXECUTABLE) |