From 14c1a82365e13fd4b8744da8a92997c012d93c23 Mon Sep 17 00:00:00 2001 From: Brent Stapleton Date: Wed, 14 Nov 2018 17:12:26 -0800 Subject: 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. --- host/cmake/Modules/UHDPython.cmake | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'host/cmake/Modules') 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=") @@ -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=") + macro(PYTHON_CHECK_MODULE desc mod cmd have) message(STATUS "") message(STATUS "Python checking for ${desc}") -- cgit v1.2.3