Python: Play nice with venvs
Vicki Pfau vi@endrift.com
Sat, 06 Jul 2019 16:10:20 -0700
1 files changed,
4 insertions(+),
1 deletions(-)
M
src/platform/python/CMakeLists.txt
→
src/platform/python/CMakeLists.txt
@@ -1,5 +1,8 @@
-find_package(PythonLibs ${USE_PYTHON_VERSION}) +if(DEFINED ENV{VIRTUAL_ENV}) + find_program(PYTHON_EXECUTABLE NAMES python PATHS "$ENV{VIRTUAL_ENV}/bin") +endif() find_package(PythonInterp ${USE_PYTHON_VERSION}) +find_package(PythonLibs ${USE_PYTHON_VERSION}) list(APPEND DEPENDENCY_LIB ${PYTHON_LIBRARIES}) include_directories(AFTER ${PYTHON_INCLUDE_DIRS})