2014-10-12 16:50:39 +03:00
|
|
|
#.rst:
|
|
|
|
# FindMINIZIP
|
|
|
|
# --------
|
|
|
|
#
|
|
|
|
# Locate Minizip library
|
|
|
|
#
|
|
|
|
# This module defines
|
|
|
|
#
|
|
|
|
# ::
|
|
|
|
#
|
2022-05-26 07:55:20 +02:00
|
|
|
# minizip_LIBRARY, the name of the library to link against
|
|
|
|
# minizip_FOUND, if false, do not try to link to Minizip
|
|
|
|
# minizip_INCLUDE_DIR, where to find unzip.h
|
|
|
|
# minizip_VERSION_STRING, human-readable string containing the version of Minizip
|
2014-10-12 16:50:39 +03:00
|
|
|
#
|
|
|
|
#=============================================================================
|
|
|
|
# Copyright 2003-2009 Kitware, Inc.
|
|
|
|
# Copyright 2012 Benjamin Eikel
|
|
|
|
#
|
|
|
|
# Distributed under the OSI-approved BSD License (the "License");
|
|
|
|
# see accompanying file kitware license.txt for details.
|
|
|
|
#
|
|
|
|
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
|
|
|
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
# See the License for more information.
|
|
|
|
#=============================================================================
|
|
|
|
# (To distribute this file outside of CMake, substitute the full
|
|
|
|
# License text for the above reference.)
|
|
|
|
|
|
|
|
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
|
|
|
set(VC_LIB_PATH_SUFFIX lib/x64)
|
|
|
|
else()
|
|
|
|
set(VC_LIB_PATH_SUFFIX lib/x86)
|
|
|
|
endif()
|
|
|
|
|
2021-03-01 10:38:21 +02:00
|
|
|
if (NOT WIN32 AND NOT APPLE_IOS)
|
2014-10-12 16:50:39 +03:00
|
|
|
find_package(PkgConfig)
|
|
|
|
if (PKG_CONFIG_FOUND)
|
|
|
|
pkg_check_modules(_MINIZIP minizip)
|
2022-05-26 07:55:20 +02:00
|
|
|
set(minizip_VERSION_STRING ${_minizip_VERSION})
|
2014-10-12 16:50:39 +03:00
|
|
|
endif ()
|
|
|
|
endif ()
|
|
|
|
|
2022-05-26 07:55:20 +02:00
|
|
|
find_path(minizip_INCLUDE_DIR
|
2014-10-12 16:50:39 +03:00
|
|
|
minizip/unzip.h
|
|
|
|
HINTS
|
2022-05-26 07:55:20 +02:00
|
|
|
${_minizip_INCLUDEDIR}
|
2014-10-12 16:50:39 +03:00
|
|
|
ENV MINIZIPDIR
|
|
|
|
PATH_SUFFIXES
|
|
|
|
MINIZIP
|
|
|
|
include
|
|
|
|
)
|
|
|
|
|
2022-05-26 07:55:20 +02:00
|
|
|
find_library(minizip_LIBRARY
|
2014-10-12 16:50:39 +03:00
|
|
|
NAMES
|
|
|
|
minizip
|
|
|
|
HINTS
|
2022-05-26 07:55:20 +02:00
|
|
|
${_minizip_LIBDIR}
|
2014-10-12 16:50:39 +03:00
|
|
|
ENV MINIZIPDIR
|
|
|
|
PATH_SUFFIXES
|
|
|
|
lib
|
|
|
|
${VC_LIB_PATH_SUFFIX}
|
|
|
|
)
|
|
|
|
|
2022-05-26 07:55:20 +02:00
|
|
|
set(minizip_LIBRARIES ${minizip_LIBRARY})
|
|
|
|
set(minizip_INCLUDE_DIRS ${minizip_INCLUDE_DIR})
|
2014-10-12 16:50:39 +03:00
|
|
|
|
|
|
|
include(FindPackageHandleStandardArgs)
|
|
|
|
|
2022-05-26 07:55:20 +02:00
|
|
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(minizip
|
|
|
|
REQUIRED_VARS minizip_LIBRARY minizip_INCLUDE_DIR
|
|
|
|
VERSION_VAR minizip_VERSION_STRING)
|
|
|
|
|
|
|
|
if (NOT TARGET "minizip::minizip" AND minizip_FOUND)
|
|
|
|
add_library(minizip::minizip UNKNOWN IMPORTED)
|
|
|
|
set_target_properties(minizip::minizip PROPERTIES
|
|
|
|
INTERFACE_INCLUDE_DIRECTORIES "${minizip_INCLUDE_DIR}")
|
|
|
|
set_target_properties(minizip::minizip PROPERTIES
|
|
|
|
IMPORTED_LOCATION "${minizip_LIBRARY}")
|
|
|
|
endif()
|