mirror of
https://github.com/EttusResearch/uhd.git
synced 2026-10-25 17:36:10 +00:00
python: cmake: Detect python virtual environments
This allows a UHD build to link to python modules installed in a virtual environment such a venv or pyenv. Signed-off-by: mattprost <matt.prost@ni.com>
This commit is contained in:
parent
e78962d8d0
commit
f1917e661e
@ -9,9 +9,9 @@
|
||||
########################################################################
|
||||
|
||||
PYTHON_CHECK_MODULE(
|
||||
"virtualenv"
|
||||
"virtual environment"
|
||||
"sys"
|
||||
"hasattr(sys, 'real_prefix')"
|
||||
"sys.prefix != sys.base_prefix"
|
||||
HAVE_PYTHON_VIRTUALENV
|
||||
)
|
||||
|
||||
@ -156,6 +156,7 @@ add_custom_command(OUTPUT ${TIMESTAMP_FILE}
|
||||
|
||||
add_custom_target(pyuhd_library ALL DEPENDS ${TIMESTAMP_FILE} pyuhd)
|
||||
if(HAVE_PYTHON_VIRTUALENV)
|
||||
message(STATUS "python virtual environment detected.")
|
||||
# In virtualenvs, let setuptools do its thing
|
||||
install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} ${SETUP_PY} -q install --force)")
|
||||
else()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user