From 9952854b53027a6dfb7058860833ce1a7d59695e Mon Sep 17 00:00:00 2001 From: WerWolv Date: Sun, 24 Dec 2023 14:37:59 +0100 Subject: [PATCH] build: Try different libarchive include path detection method --- plugins/decompress/CMakeLists.txt | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/plugins/decompress/CMakeLists.txt b/plugins/decompress/CMakeLists.txt index 7ceda0449..eeba0c150 100644 --- a/plugins/decompress/CMakeLists.txt +++ b/plugins/decompress/CMakeLists.txt @@ -4,16 +4,18 @@ include(ImHexPlugin) # Homebrew only ships a libarchive keg, include directories have to be set manually 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 DEFINED LibArchive_INCLUDE_DIR OR LibArchive_INCLUDE_DIR STREQUAL "") + if (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") + 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") + if (NOT LIBARCHIVE_PREFIX STREQUAL "") + set(LibArchive_INCLUDE_DIR "${LIBARCHIVE_PREFIX}/include") + endif() endif() endif()