diff --git a/cmake/find_package.cmake b/cmake/find_package.cmake index d183ad4..7794ed3 100644 --- a/cmake/find_package.cmake +++ b/cmake/find_package.cmake @@ -37,10 +37,23 @@ endif() find_package(Threads REQUIRED) unset(CMAKE_REQUIRED_FLAGS) +#find_program(BREW_PROGRAM "brew") +#set(HOMEBREW_PREFIX "brew --prefix") + +if (NOT DEFINED ${HOMEBREW_PREFIX}) + if (DEFINED ENV{HOMEBREW_PREFIX} AND IS_DIRECTORY ENV{HOMEBREW_PREFIX}) + set(HOMEBREW_PREFIX ENV{HOMEBREW_PREFIX}) + elseif(IS_DIRECTORY /opt/homebrew) + set(HOMEBREW_PREFIX /opt/homebrew) + else() + set(HOMEBREW_PREFIX /usr/local) + endif() +endif() + if(UNIX AND NOT APPLE) set(ICU_ROOT /usr/lib/x86_64-linux-gnu/) elseif(APPLE) - set(ICU_ROOT /usr/local/opt/icu4c/) + set(ICU_ROOT ${HOMEBREW_PREFIX}/opt/icu4c/) endif() find_package(ICU 66 COMPONENTS i18n uc)