summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Help/variable/CMAKE_SYSTEM_PREFIX_PATH.rst3
-rw-r--r--Modules/Platform/UnixPaths.cmake4
2 files changed, 7 insertions, 0 deletions
diff --git a/Help/variable/CMAKE_SYSTEM_PREFIX_PATH.rst b/Help/variable/CMAKE_SYSTEM_PREFIX_PATH.rst
index e0ee979..81a7a0b 100644
--- a/Help/variable/CMAKE_SYSTEM_PREFIX_PATH.rst
+++ b/Help/variable/CMAKE_SYSTEM_PREFIX_PATH.rst
@@ -34,6 +34,9 @@ Darwin:
OpenBSD:
* ``ENV{LOCALBASE}``
+Unix:
+ * ``ENV{CONDA_PREFIX}`` when using a conda compiler
+
Windows:
* ``ENV{ProgramW6432}``
* ``ENV{ProgramFiles}``
diff --git a/Modules/Platform/UnixPaths.cmake b/Modules/Platform/UnixPaths.cmake
index 7fe64cb..b9381c3 100644
--- a/Modules/Platform/UnixPaths.cmake
+++ b/Modules/Platform/UnixPaths.cmake
@@ -95,6 +95,10 @@ unset(_cmake_sysroot_compile)
# synchronized
if(CMAKE_COMPILER_SYSROOT)
list(PREPEND CMAKE_SYSTEM_PREFIX_PATH "${CMAKE_COMPILER_SYSROOT}")
+
+ if(DEFINED ENV{CONDA_PREFIX} AND EXISTS "$ENV{CONDA_PREFIX}")
+ list(APPEND CMAKE_SYSTEM_PREFIX_PATH "$ENV{CONDA_PREFIX}")
+ endif()
endif()
# Enable use of lib32 and lib64 search path variants by default.