Skip to content

Commit

Permalink
Try to find the brew preifx to find the installed packages correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
florianbecker committed Nov 15, 2024
1 parent 95184a8 commit 467d631
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion cmake/find_package.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 467d631

Please sign in to comment.