2

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)
2
  • Please provide the exact error message in your question post. Also, please provide the specific commands you are running..
    – Kevin
    May 14, 2020 at 14:45
  • I added command and error, please check it out. May 14, 2020 at 14:57

1 Answer 1

1

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

2
  • The only thing is include direcotry is not */libarcvhie/lib, but */libarchive/include. May 15, 2020 at 3:16
  • @DenisIvanenko Thanks, I didn't have the archive in front of me, so just was going off of the GitHub issue post. Hope this helps!
    – Kevin
    May 15, 2020 at 9:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.