mirror of
https://github.com/YosysHQ/yosys.git
synced 2026-10-06 01:53:53 +02:00
Merge pull request #6240 from YosysHQ/use_homebrew_fix
cmake: Fix Homebrew search on macOS
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
# use_homebrew([ROOT <root>])
|
||||
#
|
||||
# Includes all packages installed in `<root>` (output of brew --prefix if not
|
||||
# specified) in `CMAKE_FIND_ROOT_PATH`.
|
||||
# specified) in `CMAKE_PREFIX_PATH`.
|
||||
#
|
||||
function(use_homebrew)
|
||||
cmake_parse_arguments(PARSE_ARGV 0 arg "" "ROOT" "")
|
||||
@@ -29,9 +29,9 @@ function(use_homebrew)
|
||||
file(GLOB package_roots ${arg_ROOT}/*/*) # e.g. `/opt/homebrew/Cellar/bison/3.8.2/`
|
||||
foreach (package_root ${package_roots})
|
||||
if (IS_DIRECTORY ${package_root})
|
||||
list(APPEND CMAKE_FIND_ROOT_PATH ${package_root})
|
||||
list(APPEND CMAKE_PREFIX_PATH "${package_root}")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
return(PROPAGATE CMAKE_FIND_ROOT_PATH)
|
||||
return(PROPAGATE CMAKE_PREFIX_PATH)
|
||||
endfunction()
|
||||
|
||||
Reference in New Issue
Block a user