summaryrefslogtreecommitdiff
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-12-11 10:53:00 -0500
committerBrad King <brad.king@kitware.com>2020-12-11 13:07:17 -0500
commit1a5c1a68b6a3ffdee2a2ae106af6724eb2d4786a (patch)
treee1f0539ceee37af9475bd5848db8d41e74aeec51 /Modules
parent23df57a3a75b26ec10439f7d1d34f2f3fff2bd23 (diff)
downloadcmake-1a5c1a68b6a3ffdee2a2ae106af6724eb2d4786a.tar.gz
macOS: Add /opt/homebrew to CMAKE_SYSTEM_PREFIX_PATH on Apple Silicon
According to https://brew.sh/2020/12/01/homebrew-2.6.0/ the `/opt/homebrew` directory is recommended for installing ARM architecture brew packages. Fixes: #21585
Diffstat (limited to 'Modules')
-rw-r--r--Modules/Platform/Darwin.cmake7
1 files changed, 7 insertions, 0 deletions
diff --git a/Modules/Platform/Darwin.cmake b/Modules/Platform/Darwin.cmake
index c6de3b0d67..80595eac19 100644
--- a/Modules/Platform/Darwin.cmake
+++ b/Modules/Platform/Darwin.cmake
@@ -216,6 +216,13 @@ set(CMAKE_SYSTEM_APPBUNDLE_PATH
unset(_apps_paths)
include(Platform/UnixPaths)
+
+if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64")
+ list(PREPEND CMAKE_SYSTEM_PREFIX_PATH
+ /opt/homebrew # Brew on Apple Silicon
+ )
+endif()
+
if(_CMAKE_OSX_SYSROOT_PATH)
if(EXISTS ${_CMAKE_OSX_SYSROOT_PATH}/usr/include)
list(INSERT CMAKE_SYSTEM_PREFIX_PATH 0 ${_CMAKE_OSX_SYSROOT_PATH}/usr)