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

Closed
alt-romes opened this issue Feb 25, 2024 · 2 comments · Fixed by #1621
Closed

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

alt-romes opened this issue Feb 25, 2024 · 2 comments · Fixed by #1621
Milestone

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
Contributor

A quick fix is

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

@trollixx
Copy link
Member

trollixx commented May 19, 2024

Fixed in #1621.

@trollixx trollixx added this to the 0.7.1 milestone May 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

3 participants