diff options
author | Håkon Vågsether <haakonsv@gmail.com> | 2018-03-18 01:18:05 +0100 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2018-06-20 19:02:32 -0500 |
commit | 134e3831f20f5806c616f27c00ed51a7edd389d6 (patch) | |
tree | a138945caa5216b8cd857f58fa6d656882731406 | |
parent | dc5b37126e5d556f629cd28071a413eb2aa3ff3e (diff) | |
download | uhd-134e3831f20f5806c616f27c00ed51a7edd389d6.tar.gz uhd-134e3831f20f5806c616f27c00ed51a7edd389d6.tar.bz2 uhd-134e3831f20f5806c616f27c00ed51a7edd389d6.zip |
cmake: Fixed the Python executable finding logic
Reviewed-by: Brent Stapleton <brent.stapleton@ettus.com>
-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) |