2021-09-24 21:06:17 +02:00
|
|
|
cmake_policy(PUSH)
|
|
|
|
cmake_policy(SET CMP0012 NEW)
|
|
|
|
cmake_policy(SET CMP0057 NEW)
|
|
|
|
set(z_vcpkg_libarchive_args "")
|
|
|
|
if("REQUIRED" IN_LIST ARGS)
|
|
|
|
list(APPEND z_vcpkg_libarchive_args "REQUIRED")
|
2021-01-17 04:26:38 +01:00
|
|
|
endif()
|
2021-09-24 21:06:17 +02:00
|
|
|
if("QUIET" IN_LIST ARGS)
|
|
|
|
list(APPEND z_vcpkg_libarchive_args "QUIET")
|
2021-01-17 04:26:38 +01:00
|
|
|
endif()
|
|
|
|
|
2021-09-24 21:06:17 +02:00
|
|
|
_find_package(${ARGS})
|
|
|
|
|
|
|
|
if(LibArchive_FOUND AND "@VCPKG_LIBRARY_LINKAGE@" STREQUAL "static")
|
|
|
|
set(z_vcpkg_libarchive_libs "")
|
|
|
|
find_package(ZLIB ${z_vcpkg_libarchive_args})
|
|
|
|
list(APPEND z_vcpkg_libarchive_libs ZLIB::ZLIB)
|
2020-04-17 23:13:24 +02:00
|
|
|
if(@ENABLE_BZip2@)
|
2021-09-24 21:06:17 +02:00
|
|
|
find_package(BZip2 ${z_vcpkg_libarchive_args})
|
|
|
|
list(APPEND z_vcpkg_libarchive_libs BZip2::BZip2)
|
2020-04-17 23:13:24 +02:00
|
|
|
endif()
|
|
|
|
if(@ENABLE_LIBXML2@)
|
2021-09-24 21:06:17 +02:00
|
|
|
find_package(LibXml2 ${z_vcpkg_libarchive_args})
|
|
|
|
list(APPEND z_vcpkg_libarchive_libs LibXml2::LibXml2)
|
2020-04-17 23:13:24 +02:00
|
|
|
endif()
|
|
|
|
if(@ENABLE_LZ4@)
|
2021-09-24 21:06:17 +02:00
|
|
|
find_package(lz4 CONFIG ${z_vcpkg_libarchive_args})
|
|
|
|
list(APPEND z_vcpkg_libarchive_libs lz4::lz4)
|
2020-04-17 23:13:24 +02:00
|
|
|
endif()
|
|
|
|
if(@ENABLE_LZMA@)
|
2021-09-24 21:06:17 +02:00
|
|
|
find_package(LibLZMA ${z_vcpkg_libarchive_args})
|
|
|
|
list(APPEND z_vcpkg_libarchive_libs LibLZMA::LibLZMA)
|
2020-04-17 23:13:24 +02:00
|
|
|
endif()
|
|
|
|
if(@ENABLE_LZO@)
|
2021-09-24 21:06:17 +02:00
|
|
|
include(SelectLibraryConfigurations)
|
2022-03-23 05:37:07 +01:00
|
|
|
find_library(Z_VCPKG_LZO_LIBRARY_DEBUG NAMES lzo2d lzo2 NAMES_PER_DIR PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib" NO_DEFAULT_PATH)
|
|
|
|
find_library(Z_VCPKG_LZO_LIBRARY_RELEASE NAMES lzo2 NAMES_PER_DIR PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib" NO_DEFAULT_PATH)
|
2021-09-24 21:06:17 +02:00
|
|
|
select_library_configurations(Z_VCPKG_LZO)
|
|
|
|
if(Z_VCPKG_LZO_LIBRARY)
|
|
|
|
list(APPEND z_vcpkg_libarchive_libs ${Z_VCPKG_LZO_LIBRARY})
|
|
|
|
else()
|
|
|
|
set(LibArchive_FOUND FALSE)
|
2020-04-17 23:13:24 +02:00
|
|
|
endif()
|
|
|
|
endif()
|
2020-04-27 15:56:50 +02:00
|
|
|
if(@ENABLE_ZSTD@)
|
2021-09-24 21:06:17 +02:00
|
|
|
find_package(zstd ${z_vcpkg_libarchive_args})
|
2020-11-16 18:49:38 +01:00
|
|
|
if(TARGET zstd::libzstd_shared)
|
2021-09-24 21:06:17 +02:00
|
|
|
list(APPEND z_vcpkg_libarchive_libs zstd::libzstd_shared)
|
2020-11-16 18:49:38 +01:00
|
|
|
else(TARGET zstd::libzstd_shared)
|
2021-09-24 21:06:17 +02:00
|
|
|
list(APPEND z_vcpkg_libarchive_libs zstd::libzstd_static)
|
2020-11-16 18:49:38 +01:00
|
|
|
endif(TARGET zstd::libzstd_shared)
|
2020-04-27 15:56:50 +02:00
|
|
|
endif()
|
2023-01-25 01:40:21 +01:00
|
|
|
if(@WRAPPER_ENABLE_OPENSSL@)
|
2021-09-24 21:06:17 +02:00
|
|
|
find_package(OpenSSL ${z_vcpkg_libarchive_args})
|
|
|
|
list(APPEND z_vcpkg_libarchive_libs OpenSSL::Crypto)
|
2020-04-17 23:13:24 +02:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(TARGET LibArchive::LibArchive)
|
2023-01-21 07:12:40 +01:00
|
|
|
set(LibArchive_LIBRARIES LibArchive::LibArchive)
|
2022-03-23 05:37:07 +01:00
|
|
|
if(Z_VCPKG_LZO_LIBRARY AND Z_VCPKG_LZO_LIBRARY_DEBUG)
|
|
|
|
list(REMOVE_ITEM z_vcpkg_libarchive_libs ${Z_VCPKG_LZO_LIBRARY})
|
|
|
|
list(APPEND z_vcpkg_libarchive_libs
|
|
|
|
"\$<\$<NOT:\$<CONFIG:DEBUG>>:${Z_VCPKG_LZO_LIBRARY_RELEASE}>"
|
|
|
|
"\$<\$<CONFIG:DEBUG>:${Z_VCPKG_LZO_LIBRARY_DEBUG}>"
|
|
|
|
)
|
|
|
|
endif()
|
2021-09-24 21:06:17 +02:00
|
|
|
set_property(TARGET LibArchive::LibArchive APPEND PROPERTY INTERFACE_LINK_LIBRARIES ${z_vcpkg_libarchive_libs})
|
2023-01-21 07:12:40 +01:00
|
|
|
else()
|
|
|
|
list(APPEND LibArchive_LIBRARIES ${z_vcpkg_libarchive_libs})
|
2020-04-17 23:13:24 +02:00
|
|
|
endif()
|
2021-09-24 21:06:17 +02:00
|
|
|
unset(z_vcpkg_libarchive_libs)
|
2020-04-17 23:13:24 +02:00
|
|
|
endif()
|
2021-09-24 21:06:17 +02:00
|
|
|
unset(z_vcpkg_libarchive_args)
|
|
|
|
cmake_policy(POP)
|