diff options
author | Brent Stapleton <brent.stapleton@ettus.com> | 2018-11-14 17:12:26 -0800 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2018-11-26 18:00:30 -0800 |
commit | 14c1a82365e13fd4b8744da8a92997c012d93c23 (patch) | |
tree | 3e3c9724217fd97e3d4914b6fd01abc39c6ff1b2 /host/cmake/Modules | |
parent | c34fa6d84e7e6c499c48753e446b937d46fc63a4 (diff) | |
download | uhd-14c1a82365e13fd4b8744da8a92997c012d93c23.tar.gz uhd-14c1a82365e13fd4b8744da8a92997c012d93c23.tar.bz2 uhd-14c1a82365e13fd4b8744da8a92997c012d93c23.zip |
cmake: python: adding RUNTIME_PYTHON_EXECUTABLE
Adding a CMake variable to set the runtime Python interpreter. This
will default to PYTHON_EXECUTABLE, which is the build time Python
interpreter.
Diffstat (limited to 'host/cmake/Modules')
-rw-r--r-- | host/cmake/Modules/UHDPython.cmake | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/host/cmake/Modules/UHDPython.cmake b/host/cmake/Modules/UHDPython.cmake index fb5874ada..5ac2d991b 100644 --- a/host/cmake/Modules/UHDPython.cmake +++ b/host/cmake/Modules/UHDPython.cmake @@ -44,7 +44,8 @@ else(PYTHON_EXECUTABLE) endif(PYTHON_EXECUTABLE) #make the path to the executable appear in the cmake gui -set(PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE} CACHE FILEPATH "python interpreter") +set(PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE} CACHE FILEPATH + "python buildtime interpreter") message(STATUS "Python interpreter: ${PYTHON_EXECUTABLE}") message(STATUS "Override with: -DPYTHON_EXECUTABLE=<path-to-python>") @@ -53,6 +54,19 @@ if(NOT PYTHONINTERP_FOUND) message(FATAL_ERROR "Error: Python interpreter required by the build system.") endif(NOT PYTHONINTERP_FOUND) +#this allows the user to override RUNTIME_PYTHON_EXECUTABLE +if(NOT RUNTIME_PYTHON_EXECUTABLE) + #default to the buildtime interpreter + set(RUNTIME_PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE}) +endif(NOT RUNTIME_PYTHON_EXECUTABLE) + +#make the path to the executable appear in the cmake gui +set(RUNTIME_PYTHON_EXECUTABLE ${RUNTIME_PYTHON_EXECUTABLE} CACHE FILEPATH + "python runtime interpreter") + +message(STATUS "Python runtime interpreter: ${RUNTIME_PYTHON_EXECUTABLE}") +message(STATUS "Override with: -DRUNTIME_PYTHON_EXECUTABLE=<path-to-python>") + macro(PYTHON_CHECK_MODULE desc mod cmd have) message(STATUS "") message(STATUS "Python checking for ${desc}") |