set(MZ_COMPAT OFF)
set(MZ_BUILD_TESTS OFF)
set(MZ_BUILD_UNIT_TESTS OFF)
set(MZ_BUILD_FUZZ_TESTS OFF)
set(MZ_CODE_COVERAGE OFF)
set(MZ_FETCH_LIBS OFF)
set(MZ_BZIP2 OFF)
set(MZ_PKCRYPT OFF)
set(MZ_WZAES OFF)
set(MZ_OPENSSL OFF)
set(MZ_LIBBSD OFF)
set(SKIP_INSTALL_ALL ON)

if(Iconv_TYPE STREQUAL Bundled)
  set(CMAKE_DISABLE_FIND_PACKAGE_Iconv TRUE)
  set(Iconv_FOUND TRUE)
  set(Iconv_LIBRARIES Iconv::Iconv)
  get_target_property(Iconv_INCLUDE_DIRS ${Iconv_LIBRARIES} INTERFACE_INCLUDE_DIRECTORIES)
endif()
if(LibLZMA_TYPE STREQUAL Bundled)
  set(CMAKE_DISABLE_FIND_PACKAGE_LibLZMA TRUE)
  set(LIBLZMA_FOUND TRUE)
  set(LIBLZMA_LIBRARIES LibLZMA::LibLZMA)
  get_target_property(LIBLZMA_INCLUDE_DIRS ${LIBLZMA_LIBRARIES} INTERFACE_INCLUDE_DIRECTORIES)
endif()
if(ZLIB_TYPE STREQUAL Bundled)
  set(CMAKE_DISABLE_FIND_PACKAGE_ZLIB TRUE)
  set(ZLIB_FOUND TRUE)
  set(ZLIB_LIBRARIES ZLIB::ZLIB)
  get_target_property(ZLIB_INCLUDE_DIRS ${ZLIB_LIBRARIES} INTERFACE_INCLUDE_DIRECTORIES)
endif()
if(ZSTD_TYPE STREQUAL Bundled)
  set(CMAKE_DISABLE_FIND_PACKAGE_ZSTD TRUE)
  set(ZSTD_FOUND TRUE)
  set(ZSTD_LIBRARIES zstd::zstd)
  get_target_property(ZSTD_INCLUDE_DIRS ${ZSTD_LIBRARIES} INTERFACE_INCLUDE_DIRECTORIES)
endif()

# minizip-ng otherwise uses system libraries when we provide them above
set(CMAKE_DISABLE_FIND_PACKAGE_PkgConfig TRUE)
set(PKGCONFIG_FOUND FALSE)

add_subdirectory(minizip-ng)
dolphin_disable_warnings(minizip-ng)
