Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect path to brew's libarchive on ARM macOS #1602

Open
alt-romes opened this issue Feb 25, 2024 · 1 comment
Open

Incorrect path to brew's libarchive on ARM macOS #1602

alt-romes opened this issue Feb 25, 2024 · 1 comment

Comments

@alt-romes
Copy link

Homebrew's default location for ARM/M-series chips macOSs is /opt/homebrew/opt/libarchive/include (see /opt/homebrew/opt/libarchive/include). This causes the cmake -B build to fail because LibArchive_INCLUDE_PATH is set to the path homebrew uses for Intel macs).

These are the offending lines:

if(APPLE AND NOT LibArchive_INCLUDE_DIR)
set(LibArchive_INCLUDE_DIR "/usr/local/opt/libarchive/include")
endif()

It would probably be better to get brew's prefix with $(brew --prefix) or to predicate the prefix on the architecture.
I don't know enough CMAKE to do this myself unfortunately.

Cheers

@zchrissirhcz
Copy link

A quick fix is

export LibArchive_ROOT=/opt/homebrew/opt/libarchive
cmake -S . -B build -G Ninja && cmake --build

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants