Allow pkg-config to find libarchive on macOS

macOS already provides the libarchive libraries, so Homebrew doesn't link it.
However, macOS does not provide the headers.
This commit is contained in:
WaluigiWare64 2020-12-19 18:17:06 +00:00 committed by GitHub
parent 6b8738bb60
commit 78419dbce1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -53,6 +53,12 @@ find_package(PkgConfig REQUIRED)
find_package(Iconv REQUIRED)
pkg_check_modules(SDL2 REQUIRED sdl2)
pkg_check_modules(SLIRP REQUIRED slirp)
if (APPLE)
execute_process(COMMAND brew --prefix libarchive
OUTPUT_VARIABLE LIBARCHIVE_DIR)
set(CMAKE_PREFIX_PATH "${LIBARCHIVE_DIR}/lib/pkgconfig")
endif()
pkg_check_modules(LIBARCHIVE REQUIRED libarchive)
if (WIN32 AND (CMAKE_BUILD_TYPE STREQUAL Release))