summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'Modules')
-rw-r--r--Modules/FindPython.cmake12
-rw-r--r--Modules/FindPython/Support.cmake14
-rw-r--r--Modules/FindPython2.cmake12
-rw-r--r--Modules/FindPython3.cmake12
4 files changed, 25 insertions, 25 deletions
diff --git a/Modules/FindPython.cmake b/Modules/FindPython.cmake
index 2bdfaf3..177ed58 100644
--- a/Modules/FindPython.cmake
+++ b/Modules/FindPython.cmake
@@ -220,12 +220,12 @@ Hints
variable will be used, if any.
``Python_FIND_VIRTUALENV``
- This variable defines the handling of virtual environments. It is meaningfull
- only when a virtual environment is active (i.e. the ``activate`` script has
- been evaluated). In this case, it takes precedence over
- ``Python_FIND_REGISTRY`` and ``CMAKE_FIND_FRAMEWORK`` variables.
- The ``Python_FIND_VIRTUALENV`` variable can be set to empty or one of the
- following:
+ This variable defines the handling of virtual environments managed by
+ ``virtualenv`` or ``conda``. It is meaningful only when a virtual environment
+ is active (i.e. the ``activate`` script has been evaluated). In this case, it
+ takes precedence over ``Python_FIND_REGISTRY`` and ``CMAKE_FIND_FRAMEWORK``
+ variables. The ``Python_FIND_VIRTUALENV`` variable can be set to empty or
+ one of the following:
* ``FIRST``: The virtual environment is used before any other standard
paths to look-up for the interpreter. This is the default.
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)
diff --git a/Modules/FindPython2.cmake b/Modules/FindPython2.cmake
index 3cc7d56..9d4eda2 100644
--- a/Modules/FindPython2.cmake
+++ b/Modules/FindPython2.cmake
@@ -176,12 +176,12 @@ Hints
variable will be used, if any.
``Python2_FIND_VIRTUALENV``
- This variable defines the handling of virtual environments. It is meaningfull
- only when a virtual environment is active (i.e. the ``activate`` script has
- been evaluated). In this case, it takes precedence over
- ``Python2_FIND_REGISTRY`` and ``CMAKE_FIND_FRAMEWORK`` variables.
- The ``Python2_FIND_VIRTUALENV`` variable can be set to empty or one of the
- following:
+ This variable defines the handling of virtual environments managed by
+ ``virtualenv`` or ``conda``. It is meaningful only when a virtual environment
+ is active (i.e. the ``activate`` script has been evaluated). In this case, it
+ takes precedence over ``Python2_FIND_REGISTRY`` and ``CMAKE_FIND_FRAMEWORK``
+ variables. The ``Python2_FIND_VIRTUALENV`` variable can be set to empty or
+ one of the following:
* ``FIRST``: The virtual environment is used before any other standard
paths to look-up for the interpreter. This is the default.
diff --git a/Modules/FindPython3.cmake b/Modules/FindPython3.cmake
index 066d0df..0a96fad 100644
--- a/Modules/FindPython3.cmake
+++ b/Modules/FindPython3.cmake
@@ -217,12 +217,12 @@ Hints
variable will be used, if any.
``Python3_FIND_VIRTUALENV``
- This variable defines the handling of virtual environments. It is meaningfull
- only when a virtual environment is active (i.e. the ``activate`` script has
- been evaluated). In this case, it takes precedence over
- ``Python3_FIND_REGISTRY`` and ``CMAKE_FIND_FRAMEWORK`` variables.
- The ``Python3_FIND_VIRTUALENV`` variable can be set to empty or one of the
- following:
+ This variable defines the handling of virtual environments managed by
+ ``virtualenv`` or ``conda``. It is meaningful only when a virtual environment
+ is active (i.e. the ``activate`` script has been evaluated). In this case, it
+ takes precedence over ``Python3_FIND_REGISTRY`` and ``CMAKE_FIND_FRAMEWORK``
+ variables. The ``Python3_FIND_VIRTUALENV`` variable can be set to empty or
+ one of the following:
* ``FIRST``: The virtual environment is used before any other standard
paths to look-up for the interpreter. This is the default.