Python: Play nice with venvs

This commit is contained in:
Vicki Pfau 2019-07-06 16:10:20 -07:00
parent 5018364c01
commit c471d03c7d
1 changed files with 4 additions and 1 deletions

View File

@ -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(PythonInterp ${USE_PYTHON_VERSION})
find_package(PythonLibs ${USE_PYTHON_VERSION})
list(APPEND DEPENDENCY_LIB ${PYTHON_LIBRARIES}) list(APPEND DEPENDENCY_LIB ${PYTHON_LIBRARIES})
include_directories(AFTER ${PYTHON_INCLUDE_DIRS}) include_directories(AFTER ${PYTHON_INCLUDE_DIRS})