Issue
I am trying to install libarchive on macOS for my school project. I tried to do it using brew formulae, but CMake says that it can't detect it. How can I install libarchive in the right way?
What I tried:
brew install libarchive
What I got in CLion:
Could NOT find LibArchive (missing: LibArchive_INCLUDE_DIR)
Solution
As mentioned in this GitHub issue post, libarchive
isn't installed into the standard system paths. So, you'll need to tell CMake where to find it by setting the following in your CMake file:
set(LibArchive_INCLUDE_DIR "/usr/local/opt/libarchive/include")
Note, you may have to modify the path here to match where libarchive
was installed on your system
Answered By - Kevin Answer Checked By - Cary Denson (WPSolving Admin)