diff options
| -rw-r--r-- | contrib/minizip/CMakeLists.txt | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/contrib/minizip/CMakeLists.txt b/contrib/minizip/CMakeLists.txt index 1aaf4ac7..9f95a4ee 100644 --- a/contrib/minizip/CMakeLists.txt +++ b/contrib/minizip/CMakeLists.txt | |||
| @@ -44,6 +44,18 @@ if(NOT CPACK_INCLUDED) | |||
| 44 | include(CPack) | 44 | include(CPack) |
| 45 | endif(NOT CPACK_INCLUDED) | 45 | endif(NOT CPACK_INCLUDED) |
| 46 | 46 | ||
| 47 | if(NOT DEFINED ZLIB_BUILD_MINIZIP) | ||
| 48 | if(MINIZIP_BUILD_SHARED) | ||
| 49 | list(APPEND REQUIRED_COMPONENTS "shared") | ||
| 50 | endif(MINIZIP_BUILD_SHARED) | ||
| 51 | |||
| 52 | if(MINIZIP_BUILD_STATIC) | ||
| 53 | list(APPEND REQUIRED_COMPONENTS "static") | ||
| 54 | endif(MINIZIP_BUILD_STATIC) | ||
| 55 | |||
| 56 | find_package(ZLIB REQUIRED COMPONENTS ${REQUIRED_COMPONENTS} CONFIG) | ||
| 57 | endif(NOT DEFINED ZLIB_BUILD_MINIZIP) | ||
| 58 | |||
| 47 | if(MINIZIP_ENABLE_BZIP2) | 59 | if(MINIZIP_ENABLE_BZIP2) |
| 48 | find_package(BZip2 REQUIRED) | 60 | find_package(BZip2 REQUIRED) |
| 49 | endif(MINIZIP_ENABLE_BZIP2) | 61 | endif(MINIZIP_ENABLE_BZIP2) |
| @@ -89,10 +101,6 @@ check_c_source_compiles( | |||
| 89 | 101 | ||
| 90 | unset(CMAKE_REQUIRED_FLAGS) | 102 | unset(CMAKE_REQUIRED_FLAGS) |
| 91 | 103 | ||
| 92 | if(NOT TARGET ZLIB::ZLIB) | ||
| 93 | find_package(ZLIB REQUIRED CONFIG) | ||
| 94 | endif(NOT TARGET ZLIB::ZLIB) | ||
| 95 | |||
| 96 | set(LIBMINIZIP_SRCS ioapi.c mztools.c unzip.c zip.c) | 104 | set(LIBMINIZIP_SRCS ioapi.c mztools.c unzip.c zip.c) |
| 97 | 105 | ||
| 98 | set(LIBMINIZIP_HDRS crypt.h ints.h ioapi.h mztools.h unzip.h zip.h) | 106 | set(LIBMINIZIP_HDRS crypt.h ints.h ioapi.h mztools.h unzip.h zip.h) |
