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)
|
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
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
COMMAND_ERROR_IS_FATAL ANY
|
||||||
COMMAND_ERROR_IS_FATAL ANY
|
)
|
||||||
)
|
|
||||||
|
|
||||||
if (NOT LIBARCHIVE_PREFIX STREQUAL "")
|
if (NOT LIBARCHIVE_PREFIX STREQUAL "")
|
||||||
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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user