diff options
author | Marc Chevrier <marc.chevrier@gmail.com> | 2019-12-23 11:33:46 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-12-23 11:33:54 (GMT) |
commit | 417c533010e067ea78634e6ba50a1d2568949ad2 (patch) | |
tree | 3a25de9f6e832cec0b1de2a76c94802b62e4f0f4 /Modules/FindPython | |
parent | 20e0d3c33d5b6596e5b1e99b2a54bafcfaedafdc (diff) | |
parent | 776d27d4a4eb27f5618e682dafc1d44fba8598c6 (diff) | |
download | CMake-417c533010e067ea78634e6ba50a1d2568949ad2.zip CMake-417c533010e067ea78634e6ba50a1d2568949ad2.tar.gz CMake-417c533010e067ea78634e6ba50a1d2568949ad2.tar.bz2 |
Merge topic 'findpython_conda_support'
776d27d4a4 FindPython: Extend virtual environment handling by considering conda
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4155
Diffstat (limited to 'Modules/FindPython')
-rw-r--r-- | Modules/FindPython/Support.cmake | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Modules/FindPython/Support.cmake b/Modules/FindPython/Support.cmake index 89744ec..0163d56 100644 --- a/Modules/FindPython/Support.cmake +++ b/Modules/FindPython/Support.cmake @@ -834,8 +834,8 @@ else() set (_${_PYTHON_PREFIX}_FIND_REGISTRY "FIRST") endif() -# virtual environments handling -if (DEFINED ENV{VIRTUAL_ENV}) +# virtual environments recognition +if (DEFINED ENV{VIRTUAL_ENV} OR DEFINED ENV{CONDA_PREFIX}) if (DEFINED ${_PYTHON_PREFIX}_FIND_VIRTUALENV) if (NOT ${_PYTHON_PREFIX}_FIND_VIRTUALENV MATCHES "^(FIRST|ONLY|STANDARD)$") message (AUTHOR_WARNING "Find${_PYTHON_PREFIX}: ${${_PYTHON_PREFIX}_FIND_VIRTUALENV}: invalid value for '${_PYTHON_PREFIX}_FIND_VIRTUALENV'. 'FIRST', 'ONLY' or 'STANDARD' expected. 'FIRST' will be used instead.") @@ -930,7 +930,7 @@ if ("Interpreter" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS) NAMES ${_${_PYTHON_PREFIX}_NAMES} NAMES_PER_DIR HINTS ${_${_PYTHON_PREFIX}_HINTS} - PATHS ENV VIRTUAL_ENV + PATHS ENV VIRTUAL_ENV ENV CONDA_PREFIX PATH_SUFFIXES bin Scripts NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH @@ -1050,7 +1050,7 @@ if ("Interpreter" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS) NAMES ${_${_PYTHON_PREFIX}_NAMES} NAMES_PER_DIR HINTS ${_${_PYTHON_PREFIX}_HINTS} - PATHS ENV VIRTUAL_ENV + PATHS ENV VIRTUAL_ENV ENV CONDA_PREFIX PATH_SUFFIXES bin Scripts NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH @@ -1555,7 +1555,7 @@ if ("Development" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS set (_${_PYTHON_PREFIX}_HINTS "${${_PYTHON_PREFIX}_ROOT_DIR}" ENV ${_PYTHON_PREFIX}_ROOT_DIR) unset (_${_PYTHON_PREFIX}_VIRTUALENV_PATHS) if (_${_PYTHON_PREFIX}_FIND_VIRTUALENV MATCHES "^(FIRST|ONLY)$") - set (_${_PYTHON_PREFIX}_VIRTUALENV_PATHS ENV VIRTUAL_ENV) + set (_${_PYTHON_PREFIX}_VIRTUALENV_PATHS ENV VIRTUAL_ENV ENV CONDA_PREFIX) endif() unset (_${_PYTHON_PREFIX}_FRAMEWORK_PATHS) @@ -1786,7 +1786,7 @@ if ("Development" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS unset (_${_PYTHON_PREFIX}_VIRTUALENV_PATHS) if (_${_PYTHON_PREFIX}_FIND_VIRTUALENV MATCHES "^(FIRST|ONLY)$") - set (_${_PYTHON_PREFIX}_VIRTUALENV_PATHS ENV VIRTUAL_ENV) + set (_${_PYTHON_PREFIX}_VIRTUALENV_PATHS ENV VIRTUAL_ENV ENV CONDA_PREFIX) endif() if (_${_PYTHON_PREFIX}_FIND_STRATEGY STREQUAL "LOCATION") @@ -2007,7 +2007,7 @@ if ("Development" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS if (NOT _${_PYTHON_PREFIX}_INCLUDE_DIR) unset (_${_PYTHON_PREFIX}_VIRTUALENV_PATHS) if (_${_PYTHON_PREFIX}_FIND_VIRTUALENV MATCHES "^(FIRST|ONLY)$") - set (_${_PYTHON_PREFIX}_VIRTUALENV_PATHS ENV VIRTUAL_ENV) + set (_${_PYTHON_PREFIX}_VIRTUALENV_PATHS ENV VIRTUAL_ENV ENV CONDA_PREFIX) endif() unset (_${_PYTHON_PREFIX}_INCLUDE_HINTS) |