1
0
mirror of synced 2025-02-11 16:22:59 +01:00

build: Only fix libarchive include dirs when necessary

This commit is contained in:
WerWolv 2023-12-24 14:30:10 +01:00
parent 24f8ce9d7f
commit 7eb92c68de

View File

@ -3,9 +3,8 @@ cmake_minimum_required(VERSION 3.16)
include(ImHexPlugin) include(ImHexPlugin)
# Homebrew only ships a libarchive keg, include directories have to be set manually # Homebrew only ships a libarchive keg, include directories have to be set manually
if (APPLE) find_package(LibArchive REQUIRED)
find_package(Brew QUIET) if (APPLE AND LibArchive_INCLUDE_DIR STREQUAL "")
if (Brew_FOUND)
execute_process( execute_process(
COMMAND (${BREW_EXECUTABLE} --prefix libarchive) || exit 0 COMMAND (${BREW_EXECUTABLE} --prefix libarchive) || exit 0
OUTPUT_VARIABLE LIBARCHIVE_PREFIX OUTPUT_VARIABLE LIBARCHIVE_PREFIX
@ -17,8 +16,6 @@ if (APPLE)
set(LibArchive_INCLUDE_DIR "${LIBARCHIVE_PREFIX}/include") set(LibArchive_INCLUDE_DIR "${LIBARCHIVE_PREFIX}/include")
endif() endif()
endif() endif()
endif()
find_package(LibArchive REQUIRED)
add_imhex_plugin( add_imhex_plugin(
NAME NAME