From 19336dfba1e0fc12b459657f7389911d764c9c0f Mon Sep 17 00:00:00 2001 From: Colin Cornaby Date: Mon, 8 Jul 2024 21:11:41 -0700 Subject: [PATCH] Removing custom LibArchive check --- CMakeLists.txt | 2 +- Sources/Plasma/Apps/plClient/CMakeLists.txt | 2 +- cmake/Findlibarchive.cmake | 43 --------------------- 3 files changed, 2 insertions(+), 45 deletions(-) delete mode 100644 cmake/Findlibarchive.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index d45d0067d4..24f3192654 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -125,7 +125,7 @@ find_package(ZLIB REQUIRED) if(APPLE) find_package(Security) find_package(Metal) - find_package(libarchive REQUIRED) + find_package(LibArchive REQUIRED) elseif(UNIX) find_package(LIBSECRET) find_package(Uuid REQUIRED) diff --git a/Sources/Plasma/Apps/plClient/CMakeLists.txt b/Sources/Plasma/Apps/plClient/CMakeLists.txt index ca17ad37c3..e5f44388df 100644 --- a/Sources/Plasma/Apps/plClient/CMakeLists.txt +++ b/Sources/Plasma/Apps/plClient/CMakeLists.txt @@ -246,7 +246,7 @@ target_link_libraries( CURL::libcurl "$<$:-framework Cocoa>" "$<$:-framework QuartzCore>" - $<$:libarchive::libarchive> + $<$:LibArchive::LibArchive> ) target_include_directories(plClient PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") diff --git a/cmake/Findlibarchive.cmake b/cmake/Findlibarchive.cmake deleted file mode 100644 index ce4282414c..0000000000 --- a/cmake/Findlibarchive.cmake +++ /dev/null @@ -1,43 +0,0 @@ -include(FindPackageHandleStandardArgs) -include(SelectLibraryConfigurations) - -find_path(libarchive_INCLUDE_DIR - NAMES archive.h -) -find_library(libarchive_LIBRARY_RELEASE NAMES archive libarchive) -find_library(libarchive_LIBRARY_DEBUG NAMES archive libarchive) - -# Cope with vcpkg no longer renaming the debug library. This is needed due to MSVC's STL iterators -# not being ABI compatible from debug to release mode. -if(libwebm_LIBRARY_RELEASE AND NOT libwebm_LIBRARY_DEBUG) - foreach(prefix_path IN LISTS CMAKE_PREFIX_PATH) - if(prefix_path MATCHES "[Dd][Ee][Bb][Uu][Gg]\/?$") - list(APPEND _debug_paths "${prefix_path}") - endif() - if(_debug_paths) - find_library(libarchive_LIBRARY_DEBUG - NAMES archive libarchive archived libarchived - PATHS ${_debug_paths} - PATH_SUFFIXES lib - NO_CMAKE_PATH - ) - endif() - endforeach() -endif() - -select_library_configurations(libarchive) -find_package_handle_standard_args(libarchive REQUIRED_VARS libarchive_INCLUDE_DIR libarchive_LIBRARY) - -if(libarchive_FOUND AND NOT TARGET libarchive::libarchive) - add_library(libarchive::libarchive IMPORTED UNKNOWN) - set_target_properties(libarchive::libarchive PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${libarchive_INCLUDE_DIR}) - if(libarchive_LIBRARY_RELEASE AND libarchive_LIBRARY_DEBUG) - set_target_properties( - libarchive::libarchive PROPERTIES - IMPORTED_LOCATION_DEBUG ${libarchive_LIBRARY_DEBUG} - IMPORTED_LOCATION_RELEASE ${libarchive_LIBRARY_RELEASE} - ) - else() - set_target_properties(libarchive::libarchive PROPERTIES IMPORTED_LOCATION ${libarchive_LIBRARY}) - endif() -endif()