From 50879ce4124508546674c7d2e681fe49840a9c73 Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Tue, 12 May 2020 16:51:23 -0400 Subject: Conda: Add CONDA_PREFIX as an acceptable system prefix path --- Help/variable/CMAKE_SYSTEM_PREFIX_PATH.rst | 3 +++ Modules/Platform/UnixPaths.cmake | 4 ++++ 2 files changed, 7 insertions(+) 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. -- cgit v0.12