Commit a59373a5 authored by Brent Stapleton's avatar Brent Stapleton Committed by michael-west

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.
parent 9fc4b029
......@@ -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}")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment