build: Only fix libarchive include dirs when necessary
This commit is contained in:
parent
24f8ce9d7f
commit
7eb92c68de
@ -3,22 +3,19 @@ cmake_minimum_required(VERSION 3.16)
|
||||
include(ImHexPlugin)
|
||||
|
||||
# Homebrew only ships a libarchive keg, include directories have to be set manually
|
||||
if (APPLE)
|
||||
find_package(Brew QUIET)
|
||||
if (Brew_FOUND)
|
||||
execute_process(
|
||||
COMMAND (${BREW_EXECUTABLE} --prefix libarchive) || exit 0
|
||||
OUTPUT_VARIABLE LIBARCHIVE_PREFIX
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
COMMAND_ERROR_IS_FATAL ANY
|
||||
)
|
||||
find_package(LibArchive REQUIRED)
|
||||
if (APPLE AND LibArchive_INCLUDE_DIR STREQUAL "")
|
||||
execute_process(
|
||||
COMMAND (${BREW_EXECUTABLE} --prefix libarchive) || exit 0
|
||||
OUTPUT_VARIABLE LIBARCHIVE_PREFIX
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
COMMAND_ERROR_IS_FATAL ANY
|
||||
)
|
||||
|
||||
if (NOT LIBARCHIVE_PREFIX STREQUAL "")
|
||||
set(LibArchive_INCLUDE_DIR "${LIBARCHIVE_PREFIX}/include")
|
||||
endif()
|
||||
if (NOT LIBARCHIVE_PREFIX STREQUAL "")
|
||||
set(LibArchive_INCLUDE_DIR "${LIBARCHIVE_PREFIX}/include")
|
||||
endif()
|
||||
endif()
|
||||
find_package(LibArchive REQUIRED)
|
||||
|
||||
add_imhex_plugin(
|
||||
NAME
|
||||
|
Loading…
x
Reference in New Issue
Block a user