|
6ea30fb…
|
florian
|
1 |
cmake_minimum_required(VERSION 3.12...3.31) |
|
6ea30fb…
|
florian
|
2 |
|
|
6ea30fb…
|
florian
|
3 |
project( |
|
6ea30fb…
|
florian
|
4 |
minizip |
|
6ea30fb…
|
florian
|
5 |
VERSION 1.0.0 |
|
6ea30fb…
|
florian
|
6 |
LANGUAGES C |
|
6ea30fb…
|
florian
|
7 |
DESCRIPTION "A library for creating zipfiles based in zlib" |
|
6ea30fb…
|
florian
|
8 |
HOMEPAGE_URL "https://www.winimage.com/zLibDll/minizip.html") |
|
6ea30fb…
|
florian
|
9 |
|
|
6ea30fb…
|
florian
|
10 |
if(CMAKE_SIZEOF_VOID_P LESS 8 AND NOT MINGW) |
|
6ea30fb…
|
florian
|
11 |
message(WARNING "libminizip needs 64bit - stopping here") |
|
6ea30fb…
|
florian
|
12 |
return() |
|
6ea30fb…
|
florian
|
13 |
endif(CMAKE_SIZEOF_VOID_P LESS 8 AND NOT MINGW) |
|
6ea30fb…
|
florian
|
14 |
|
|
6ea30fb…
|
florian
|
15 |
# ============================================================================ |
|
6ea30fb…
|
florian
|
16 |
# CPack |
|
6ea30fb…
|
florian
|
17 |
# ============================================================================ |
|
6ea30fb…
|
florian
|
18 |
set(CPACK_PACKAGE_VENDOR "zlib-Project") |
|
6ea30fb…
|
florian
|
19 |
set(CPACK_PACKAGE_DESCRIPTION_FILE ${minizip_SOURCE_DIR}/MiniZip64_info.txt) |
|
6ea30fb…
|
florian
|
20 |
set(CPACK_RESOURCE_FILE_LICENSE ${minizip_SOURCE_DIR}/../../LICENSE) |
|
6ea30fb…
|
florian
|
21 |
set(CPACK_RESOURCE_FILE_README ${minizip_SOURCE_DIR}/MiniZip64_info.txt) |
|
6ea30fb…
|
florian
|
22 |
|
|
6ea30fb…
|
florian
|
23 |
# ============================================================================ |
|
6ea30fb…
|
florian
|
24 |
# set options if build from zlib |
|
6ea30fb…
|
florian
|
25 |
# ============================================================================ |
|
6ea30fb…
|
florian
|
26 |
if(ZLIB_BUILD_MINIZIP) |
|
6ea30fb…
|
florian
|
27 |
set(MINIZIP_BUILD_SHARED ${ZLIB_MINIZIP_BUILD_SHARED} CACHE BOOL "") |
|
6ea30fb…
|
florian
|
28 |
set(MINIZIP_BUILD_STATIC ${ZLIB_MINIZIP_BUILD_STATIC} CACHE BOOL "") |
|
6ea30fb…
|
florian
|
29 |
set(MINIZIP_BUILD_TESTING ${ZLIB_MINIZIP_INSTALL} CACHE BOOL "") |
|
6ea30fb…
|
florian
|
30 |
set(MINIZIP_INSTALL ${ZLIB_MINIZIP_INSTALL} CACHE BOOL "") |
|
6ea30fb…
|
florian
|
31 |
endif(ZLIB_BUILD_MINIZIP) |
|
6ea30fb…
|
florian
|
32 |
|
|
6ea30fb…
|
florian
|
33 |
# ============================================================================ |
|
6ea30fb…
|
florian
|
34 |
# configuration |
|
6ea30fb…
|
florian
|
35 |
# ============================================================================ |
|
6ea30fb…
|
florian
|
36 |
option(MINIZIP_BUILD_SHARED "Enable building minizip shared library" ON) |
|
6ea30fb…
|
florian
|
37 |
option(MINIZIP_BUILD_STATIC "Enable building minizip static library" ON) |
|
6ea30fb…
|
florian
|
38 |
option(MINIZIP_BUILD_TESTING "Enable testing of minizip" ON) |
|
6ea30fb…
|
florian
|
39 |
option(MINIZIP_ENABLE_BZIP2 "Build minizip with bzip2 support" OFF) |
|
6ea30fb…
|
florian
|
40 |
option(MINIZIP_INSTALL "Enable installation of minizip" ON) |
|
6ea30fb…
|
florian
|
41 |
|
|
6ea30fb…
|
florian
|
42 |
include(CheckCSourceCompiles) |
|
6ea30fb…
|
florian
|
43 |
include(CheckFunctionExists) |
|
6ea30fb…
|
florian
|
44 |
include(CheckIncludeFile) |
|
6ea30fb…
|
florian
|
45 |
include(CMakePackageConfigHelpers) |
|
6ea30fb…
|
florian
|
46 |
include(CheckTypeSize) |
|
6ea30fb…
|
florian
|
47 |
include(GNUInstallDirs) |
|
6ea30fb…
|
florian
|
48 |
|
|
6ea30fb…
|
florian
|
49 |
if(NOT CPACK_INCLUDED) |
|
6ea30fb…
|
florian
|
50 |
include(CPack) |
|
6ea30fb…
|
florian
|
51 |
endif(NOT CPACK_INCLUDED) |
|
6ea30fb…
|
florian
|
52 |
|
|
6ea30fb…
|
florian
|
53 |
if(NOT DEFINED ZLIB_BUILD_MINIZIP) |
|
6ea30fb…
|
florian
|
54 |
if(MINIZIP_BUILD_SHARED) |
|
6ea30fb…
|
florian
|
55 |
list(APPEND REQUIRED_COMPONENTS "shared") |
|
6ea30fb…
|
florian
|
56 |
endif(MINIZIP_BUILD_SHARED) |
|
6ea30fb…
|
florian
|
57 |
|
|
6ea30fb…
|
florian
|
58 |
if(MINIZIP_BUILD_STATIC) |
|
6ea30fb…
|
florian
|
59 |
list(APPEND REQUIRED_COMPONENTS "static") |
|
6ea30fb…
|
florian
|
60 |
endif(MINIZIP_BUILD_STATIC) |
|
6ea30fb…
|
florian
|
61 |
|
|
6ea30fb…
|
florian
|
62 |
find_package(ZLIB REQUIRED COMPONENTS ${REQUIRED_COMPONENTS} CONFIG) |
|
6ea30fb…
|
florian
|
63 |
endif(NOT DEFINED ZLIB_BUILD_MINIZIP) |
|
6ea30fb…
|
florian
|
64 |
|
|
6ea30fb…
|
florian
|
65 |
if(MINIZIP_ENABLE_BZIP2) |
|
6ea30fb…
|
florian
|
66 |
find_package(BZip2 REQUIRED) |
|
6ea30fb…
|
florian
|
67 |
endif(MINIZIP_ENABLE_BZIP2) |
|
6ea30fb…
|
florian
|
68 |
|
|
6ea30fb…
|
florian
|
69 |
# |
|
6ea30fb…
|
florian
|
70 |
# Check for fopen64 |
|
6ea30fb…
|
florian
|
71 |
# |
|
6ea30fb…
|
florian
|
72 |
check_function_exists(fopen64 HAVE_FOPEN64) |
|
6ea30fb…
|
florian
|
73 |
|
|
6ea30fb…
|
florian
|
74 |
# |
|
6ea30fb…
|
florian
|
75 |
# Check for fseeko |
|
6ea30fb…
|
florian
|
76 |
# |
|
6ea30fb…
|
florian
|
77 |
check_function_exists(fseeko HAVE_FSEEKO) |
|
6ea30fb…
|
florian
|
78 |
|
|
6ea30fb…
|
florian
|
79 |
# |
|
6ea30fb…
|
florian
|
80 |
# Check for unistd.h |
|
6ea30fb…
|
florian
|
81 |
# |
|
6ea30fb…
|
florian
|
82 |
check_include_file(unistd.h HAVE_UNISTD_H) |
|
6ea30fb…
|
florian
|
83 |
|
|
6ea30fb…
|
florian
|
84 |
# |
|
6ea30fb…
|
florian
|
85 |
# Check to see if we have large file support |
|
6ea30fb…
|
florian
|
86 |
# |
|
6ea30fb…
|
florian
|
87 |
set(CMAKE_REQUIRED_DEFINITIONS -D_LARGEFILE64_SOURCE=1) |
|
6ea30fb…
|
florian
|
88 |
check_type_size(off64_t OFF64_T) |
|
6ea30fb…
|
florian
|
89 |
unset(CMAKE_REQUIRED_DEFINITIONS) # clear variable |
|
6ea30fb…
|
florian
|
90 |
|
|
6ea30fb…
|
florian
|
91 |
# |
|
6ea30fb…
|
florian
|
92 |
# Check visibility attribute is supported |
|
6ea30fb…
|
florian
|
93 |
# |
|
6ea30fb…
|
florian
|
94 |
if(MSVC) |
|
6ea30fb…
|
florian
|
95 |
set(CMAKE_REQUIRED_FLAGS "-WX") |
|
6ea30fb…
|
florian
|
96 |
else(MSVC) |
|
6ea30fb…
|
florian
|
97 |
set(CMAKE_REQUIRED_FLAGS "-WError") |
|
6ea30fb…
|
florian
|
98 |
endif(MSVC) |
|
6ea30fb…
|
florian
|
99 |
|
|
6ea30fb…
|
florian
|
100 |
check_c_source_compiles( |
|
6ea30fb…
|
florian
|
101 |
" |
|
6ea30fb…
|
florian
|
102 |
#include <stdlib.h> |
|
6ea30fb…
|
florian
|
103 |
static void f(void) __attribute__ ((visibility(\"hidden\"))); |
|
6ea30fb…
|
florian
|
104 |
int main(void) {return 0;} |
|
6ea30fb…
|
florian
|
105 |
" |
|
6ea30fb…
|
florian
|
106 |
HAVE___ATTR__VIS_HIDDEN) |
|
6ea30fb…
|
florian
|
107 |
|
|
6ea30fb…
|
florian
|
108 |
unset(CMAKE_REQUIRED_FLAGS) |
|
6ea30fb…
|
florian
|
109 |
|
|
6ea30fb…
|
florian
|
110 |
set(LIBMINIZIP_SRCS ioapi.c mztools.c unzip.c zip.c) |
|
6ea30fb…
|
florian
|
111 |
|
|
6ea30fb…
|
florian
|
112 |
set(LIBMINIZIP_HDRS crypt.h ints.h ioapi.h mztools.h unzip.h zip.h) |
|
6ea30fb…
|
florian
|
113 |
|
|
6ea30fb…
|
florian
|
114 |
set(MINIZIP_SRCS ioapi.c $<$<BOOL:${WIN32}>:iowin32.c> minizip.c zip.c) |
|
6ea30fb…
|
florian
|
115 |
|
|
6ea30fb…
|
florian
|
116 |
set(MINIZIP_HDRS crypt.h ints.h ioapi.h $<$<BOOL:${WIN32}>:iowin32.h> skipset.h |
|
6ea30fb…
|
florian
|
117 |
zip.h) |
|
6ea30fb…
|
florian
|
118 |
|
|
6ea30fb…
|
florian
|
119 |
set(MINIUNZIP_SRCS ioapi.c $<$<BOOL:${WIN32}>:iowin32.c> miniunz.c unzip.c |
|
6ea30fb…
|
florian
|
120 |
zip.c) |
|
6ea30fb…
|
florian
|
121 |
|
|
6ea30fb…
|
florian
|
122 |
set(MINIUNZIP_HDRS |
|
6ea30fb…
|
florian
|
123 |
crypt.h |
|
6ea30fb…
|
florian
|
124 |
ints.h |
|
6ea30fb…
|
florian
|
125 |
ioapi.h |
|
6ea30fb…
|
florian
|
126 |
$<$<BOOL:${WIN32}>:iowin32.h> |
|
6ea30fb…
|
florian
|
127 |
skipset.h |
|
6ea30fb…
|
florian
|
128 |
unzip.h |
|
6ea30fb…
|
florian
|
129 |
zip.h) |
|
6ea30fb…
|
florian
|
130 |
|
|
6ea30fb…
|
florian
|
131 |
if(WIN32 OR CYGWIN) |
|
6ea30fb…
|
florian
|
132 |
set(minizip_static_suffix "s") |
|
6ea30fb…
|
florian
|
133 |
set(CMAKE_DEBUG_POSTFIX "d") |
|
6ea30fb…
|
florian
|
134 |
endif(WIN32 OR CYGWIN) |
|
6ea30fb…
|
florian
|
135 |
|
|
6ea30fb…
|
florian
|
136 |
if(MINIZIP_BUILD_SHARED) |
|
6ea30fb…
|
florian
|
137 |
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE) |
|
6ea30fb…
|
florian
|
138 |
add_library(libminizip SHARED ${LIBMINIZIP_SRCS} ${LIBMINIZIP_HDRS}) |
|
6ea30fb…
|
florian
|
139 |
add_library(MINIZIP::minizip ALIAS libminizip) |
|
6ea30fb…
|
florian
|
140 |
target_include_directories( |
|
6ea30fb…
|
florian
|
141 |
libminizip PUBLIC $<BUILD_INTERFACE:${minizip_SOURCE_DIR}> |
|
6ea30fb…
|
florian
|
142 |
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>) |
|
6ea30fb…
|
florian
|
143 |
target_compile_definitions( |
|
6ea30fb…
|
florian
|
144 |
libminizip |
|
6ea30fb…
|
florian
|
145 |
PRIVATE $<$<BOOL:${MSVC}>:_CRT_SECURE_NO_WARNINGS> |
|
6ea30fb…
|
florian
|
146 |
$<$<BOOL:${HAVE___ATTR__VIS_HIDDEN}>:HAVE_HIDDEN> |
|
6ea30fb…
|
florian
|
147 |
$<$<BOOL:${HAVE_UNISTD_H}>:HAVE_UNISTD_H=1> |
|
6ea30fb…
|
florian
|
148 |
PUBLIC $<$<BOOL:${HAVE_OFF64_T}>:_LARGEFILE64_SOURCE=1> |
|
6ea30fb…
|
florian
|
149 |
$<$<BOOL:${BZIP2_FOUND}>:HAVE_BZIP2=1> |
|
6ea30fb…
|
florian
|
150 |
$<$<BOOL:NOT:${HAVE_FOPEN64}>:USE_FILE32API=1>) |
|
6ea30fb…
|
florian
|
151 |
|
|
6ea30fb…
|
florian
|
152 |
if(NOT CYGWIN) |
|
6ea30fb…
|
florian
|
153 |
set_target_properties(libminizip PROPERTIES SOVERSION |
|
6ea30fb…
|
florian
|
154 |
${minizip_VERSION_MAJOR}) |
|
6ea30fb…
|
florian
|
155 |
endif(NOT CYGWIN) |
|
6ea30fb…
|
florian
|
156 |
|
|
6ea30fb…
|
florian
|
157 |
set_target_properties( |
|
6ea30fb…
|
florian
|
158 |
libminizip |
|
6ea30fb…
|
florian
|
159 |
PROPERTIES EXPORT_NAME minizip |
|
6ea30fb…
|
florian
|
160 |
OUTPUT_NAME minizip |
|
6ea30fb…
|
florian
|
161 |
VERSION ${minizip_VERSION} |
|
6ea30fb…
|
florian
|
162 |
SOVERSION ${minizip_VERSION_MAJOR}) |
|
6ea30fb…
|
florian
|
163 |
|
|
6ea30fb…
|
florian
|
164 |
target_link_libraries(libminizip |
|
6ea30fb…
|
florian
|
165 |
PUBLIC ZLIB::ZLIB |
|
6ea30fb…
|
florian
|
166 |
$<$<BOOL:${BZIP2_FOUND}>:BZip2::BZip2>) |
|
6ea30fb…
|
florian
|
167 |
|
|
6ea30fb…
|
florian
|
168 |
add_executable(minizip ${MINIZIP_SRCS} ${MINIZIP_HDRS}) |
|
6ea30fb…
|
florian
|
169 |
set_target_properties(minizip PROPERTIES EXPORT_NAME minizip_executable) |
|
6ea30fb…
|
florian
|
170 |
target_compile_definitions( |
|
6ea30fb…
|
florian
|
171 |
minizip PRIVATE $<$<BOOL:${MSVC}>:_CRT_SECURE_NO_WARNINGS>) |
|
6ea30fb…
|
florian
|
172 |
target_link_libraries(minizip PRIVATE MINIZIP::minizip) |
|
6ea30fb…
|
florian
|
173 |
add_executable(miniunzip ${MINIUNZIP_SRCS} ${MINIUNZIP_HDRS}) |
|
6ea30fb…
|
florian
|
174 |
set_target_properties(miniunzip PROPERTIES EXPORT_NAME miniunzip_executable) |
|
6ea30fb…
|
florian
|
175 |
target_compile_definitions( |
|
6ea30fb…
|
florian
|
176 |
miniunzip PRIVATE $<$<BOOL:${MSVC}>:_CRT_SECURE_NO_WARNINGS>) |
|
6ea30fb…
|
florian
|
177 |
target_link_libraries(miniunzip PRIVATE MINIZIP::minizip) |
|
6ea30fb…
|
florian
|
178 |
endif(MINIZIP_BUILD_SHARED) |
|
6ea30fb…
|
florian
|
179 |
|
|
6ea30fb…
|
florian
|
180 |
if(MINIZIP_BUILD_STATIC) |
|
6ea30fb…
|
florian
|
181 |
add_library(libminizipstatic STATIC ${LIBMINIZIP_SRCS} ${LIBMINIZIP_HDRS}) |
|
6ea30fb…
|
florian
|
182 |
add_library(MINIZIP::minizipstatic ALIAS libminizipstatic) |
|
6ea30fb…
|
florian
|
183 |
target_include_directories( |
|
6ea30fb…
|
florian
|
184 |
libminizipstatic |
|
6ea30fb…
|
florian
|
185 |
PUBLIC $<BUILD_INTERFACE:${minizip_SOURCE_DIR}> |
|
6ea30fb…
|
florian
|
186 |
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>) |
|
6ea30fb…
|
florian
|
187 |
target_compile_definitions( |
|
6ea30fb…
|
florian
|
188 |
libminizipstatic |
|
6ea30fb…
|
florian
|
189 |
PRIVATE $<$<BOOL:${MSVC}>:_CRT_SECURE_NO_WARNINGS> |
|
6ea30fb…
|
florian
|
190 |
$<$<BOOL:${HAVE___ATTR__VIS_HIDDEN}>:HAVE_HIDDEN> |
|
6ea30fb…
|
florian
|
191 |
$<$<BOOL:${HAVE_UNISTD_H}>:HAVE_UNISTD_H=1> |
|
6ea30fb…
|
florian
|
192 |
PUBLIC $<$<BOOL:${HAVE_OFF64_T}>:_LARGEFILE64_SOURCE=1> |
|
6ea30fb…
|
florian
|
193 |
$<$<BOOL:${BZIP2_FOUND}>:HAVE_BZIP2=1> |
|
6ea30fb…
|
florian
|
194 |
$<$<BOOL:NOT:${HAVE_FOPEN64}>:USE_FILE32API=1>) |
|
6ea30fb…
|
florian
|
195 |
set_target_properties( |
|
6ea30fb…
|
florian
|
196 |
libminizipstatic PROPERTIES EXPORT_NAME minizipstatic |
|
6ea30fb…
|
florian
|
197 |
OUTPUT_NAME minizip${minizip_static_suffix}) |
|
6ea30fb…
|
florian
|
198 |
|
|
6ea30fb…
|
florian
|
199 |
if(CYGWIN) |
|
6ea30fb…
|
florian
|
200 |
set_target_properties(libminizipstatic PROPERTIES SUFFIX ".dll.a") |
|
6ea30fb…
|
florian
|
201 |
endif(CYGWIN) |
|
6ea30fb…
|
florian
|
202 |
|
|
6ea30fb…
|
florian
|
203 |
target_link_libraries(libminizipstatic PUBLIC ZLIB::ZLIBSTATIC |
|
6ea30fb…
|
florian
|
204 |
$<$<BOOL:${BZIP2_FOUND}>:BZip2::BZip2>) |
|
6ea30fb…
|
florian
|
205 |
|
|
6ea30fb…
|
florian
|
206 |
add_executable(minizipstatic ${MINIZIP_SRCS} ${MINIZIP_HDRS}) |
|
6ea30fb…
|
florian
|
207 |
set_target_properties(minizipstatic PROPERTIES EXPORT_NAME |
|
6ea30fb…
|
florian
|
208 |
minizip_static_executable) |
|
6ea30fb…
|
florian
|
209 |
target_compile_definitions( |
|
6ea30fb…
|
florian
|
210 |
minizipstatic PRIVATE $<$<BOOL:${MSVC}>:_CRT_SECURE_NO_WARNINGS>) |
|
6ea30fb…
|
florian
|
211 |
target_link_libraries(minizipstatic PRIVATE MINIZIP::minizipstatic) |
|
6ea30fb…
|
florian
|
212 |
add_executable(miniunzipstatic ${MINIUNZIP_SRCS} ${MINIUNZIP_HDRS}) |
|
6ea30fb…
|
florian
|
213 |
set_target_properties(miniunzipstatic |
|
6ea30fb…
|
florian
|
214 |
PROPERTIES EXPORT_NAME miniunzip_static_executable) |
|
6ea30fb…
|
florian
|
215 |
target_compile_definitions( |
|
6ea30fb…
|
florian
|
216 |
miniunzipstatic PRIVATE $<$<BOOL:${MSVC}>:_CRT_SECURE_NO_WARNINGS>) |
|
6ea30fb…
|
florian
|
217 |
target_link_libraries(miniunzipstatic PRIVATE MINIZIP::minizipstatic) |
|
6ea30fb…
|
florian
|
218 |
endif(MINIZIP_BUILD_STATIC) |
|
6ea30fb…
|
florian
|
219 |
|
|
6ea30fb…
|
florian
|
220 |
if(MINIZIP_INSTALL) |
|
6ea30fb…
|
florian
|
221 |
if(MINIZIP_BUILD_SHARED) |
|
6ea30fb…
|
florian
|
222 |
install( |
|
6ea30fb…
|
florian
|
223 |
TARGETS libminizip minizip miniunzip |
|
6ea30fb…
|
florian
|
224 |
COMPONENT Runtime |
|
6ea30fb…
|
florian
|
225 |
EXPORT minizipSharedExport |
|
6ea30fb…
|
florian
|
226 |
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" |
|
6ea30fb…
|
florian
|
227 |
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" |
|
6ea30fb…
|
florian
|
228 |
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}") |
|
6ea30fb…
|
florian
|
229 |
install( |
|
6ea30fb…
|
florian
|
230 |
EXPORT minizipSharedExport |
|
6ea30fb…
|
florian
|
231 |
FILE minizip-shared.cmake |
|
6ea30fb…
|
florian
|
232 |
NAMESPACE MINIZIP:: |
|
6ea30fb…
|
florian
|
233 |
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/minizip) |
|
6ea30fb…
|
florian
|
234 |
|
|
6ea30fb…
|
florian
|
235 |
if(MSVC) |
|
6ea30fb…
|
florian
|
236 |
install( |
|
6ea30fb…
|
florian
|
237 |
FILES $<TARGET_PDB_FILE:libminizip> |
|
6ea30fb…
|
florian
|
238 |
COMPONENT Runtime |
|
6ea30fb…
|
florian
|
239 |
DESTINATION ${CMAKE_INSTALL_BINDIR} |
|
6ea30fb…
|
florian
|
240 |
CONFIGURATIONS Debug OR RelWithDebInfo |
|
6ea30fb…
|
florian
|
241 |
OPTIONAL) |
|
6ea30fb…
|
florian
|
242 |
endif(MSVC) |
|
6ea30fb…
|
florian
|
243 |
endif(MINIZIP_BUILD_SHARED) |
|
6ea30fb…
|
florian
|
244 |
|
|
6ea30fb…
|
florian
|
245 |
if(MINIZIP_BUILD_STATIC) |
|
6ea30fb…
|
florian
|
246 |
install( |
|
6ea30fb…
|
florian
|
247 |
TARGETS libminizipstatic |
|
6ea30fb…
|
florian
|
248 |
COMPONENT Development |
|
6ea30fb…
|
florian
|
249 |
TARGETS minizipstatic miniunzipstatic |
|
6ea30fb…
|
florian
|
250 |
COMPONENT Runtime |
|
6ea30fb…
|
florian
|
251 |
EXPORT minizipStaticExport |
|
6ea30fb…
|
florian
|
252 |
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" |
|
6ea30fb…
|
florian
|
253 |
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" |
|
6ea30fb…
|
florian
|
254 |
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}") |
|
6ea30fb…
|
florian
|
255 |
install( |
|
6ea30fb…
|
florian
|
256 |
EXPORT minizipStaticExport |
|
6ea30fb…
|
florian
|
257 |
FILE minizip-static.cmake |
|
6ea30fb…
|
florian
|
258 |
NAMESPACE MINIZIP:: |
|
6ea30fb…
|
florian
|
259 |
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/minizip) |
|
6ea30fb…
|
florian
|
260 |
endif(MINIZIP_BUILD_STATIC) |
|
6ea30fb…
|
florian
|
261 |
|
|
6ea30fb…
|
florian
|
262 |
configure_package_config_file( |
|
6ea30fb…
|
florian
|
263 |
${minizip_SOURCE_DIR}/minizipConfig.cmake.in |
|
6ea30fb…
|
florian
|
264 |
${minizip_BINARY_DIR}/minizipConfig.cmake |
|
6ea30fb…
|
florian
|
265 |
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/minizip) |
|
6ea30fb…
|
florian
|
266 |
write_basic_package_version_file( |
|
6ea30fb…
|
florian
|
267 |
"${minizip_BINARY_DIR}/minizipConfigVersion.cmake" |
|
6ea30fb…
|
florian
|
268 |
VERSION "${minizip_VERSION}" |
|
6ea30fb…
|
florian
|
269 |
COMPATIBILITY AnyNewerVersion) |
|
6ea30fb…
|
florian
|
270 |
install(FILES ${minizip_BINARY_DIR}/minizipConfig.cmake |
|
6ea30fb…
|
florian
|
271 |
${minizip_BINARY_DIR}/minizipConfigVersion.cmake |
|
6ea30fb…
|
florian
|
272 |
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/minizip) |
|
6ea30fb…
|
florian
|
273 |
install( |
|
6ea30fb…
|
florian
|
274 |
FILES ${LIBMINIZIP_HDRS} |
|
6ea30fb…
|
florian
|
275 |
COMPONENT Development |
|
6ea30fb…
|
florian
|
276 |
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") |
|
6ea30fb…
|
florian
|
277 |
endif(MINIZIP_INSTALL) |
|
6ea30fb…
|
florian
|
278 |
|
|
6ea30fb…
|
florian
|
279 |
if(MINIZIP_BUILD_TESTING) |
|
6ea30fb…
|
florian
|
280 |
enable_testing() |
|
6ea30fb…
|
florian
|
281 |
|
|
6ea30fb…
|
florian
|
282 |
if(MINIZIP_BUILD_SHARED AND NOT ${CMAKE_SHARED_LIBRARY_SUFFIX} STREQUAL |
|
6ea30fb…
|
florian
|
283 |
".dll") |
|
6ea30fb…
|
florian
|
284 |
add_test( |
|
6ea30fb…
|
florian
|
285 |
NAME minizip_prepare_shared_zip |
|
6ea30fb…
|
florian
|
286 |
COMMAND ${CMAKE_COMMAND} -DCREATE_SHARED=ON -P |
|
6ea30fb…
|
florian
|
287 |
${CMAKE_CURRENT_SOURCE_DIR}/test/test_helper.cm |
|
6ea30fb…
|
florian
|
288 |
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/test) |
|
6ea30fb…
|
florian
|
289 |
add_test( |
|
6ea30fb…
|
florian
|
290 |
NAME minizip_zipping_test_file_shared |
|
6ea30fb…
|
florian
|
291 |
COMMAND minizip test_file_shared.zip test_file_shared.txt |
|
6ea30fb…
|
florian
|
292 |
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/test) |
|
6ea30fb…
|
florian
|
293 |
add_test( |
|
6ea30fb…
|
florian
|
294 |
NAME minizip_prepare_shared_unzip |
|
6ea30fb…
|
florian
|
295 |
COMMAND ${CMAKE_COMMAND} -DMOVE_SHARED=ON -P |
|
6ea30fb…
|
florian
|
296 |
${CMAKE_CURRENT_SOURCE_DIR}/test/test_helper.cm |
|
6ea30fb…
|
florian
|
297 |
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/test) |
|
6ea30fb…
|
florian
|
298 |
add_test( |
|
6ea30fb…
|
florian
|
299 |
NAME minizip_miniunzipping_test_file_shared.zip |
|
6ea30fb…
|
florian
|
300 |
COMMAND miniunzip test_file_shared.zip |
|
6ea30fb…
|
florian
|
301 |
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/test) |
|
6ea30fb…
|
florian
|
302 |
add_test( |
|
6ea30fb…
|
florian
|
303 |
NAME minizip_compare_shared |
|
6ea30fb…
|
florian
|
304 |
COMMAND ${CMAKE_COMMAND} -E compare_files test_file_shared.txt |
|
6ea30fb…
|
florian
|
305 |
test_file_shared.orig |
|
6ea30fb…
|
florian
|
306 |
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/test) |
|
6ea30fb…
|
florian
|
307 |
add_test( |
|
6ea30fb…
|
florian
|
308 |
NAME minizip_clean_shared_zip |
|
6ea30fb…
|
florian
|
309 |
COMMAND ${CMAKE_COMMAND} -DDELETE_SHARED=ON -P |
|
6ea30fb…
|
florian
|
310 |
${CMAKE_CURRENT_SOURCE_DIR}/test/test_helper.cm |
|
6ea30fb…
|
florian
|
311 |
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/test) |
|
6ea30fb…
|
florian
|
312 |
set_tests_properties(minizip_prepare_shared_zip |
|
6ea30fb…
|
florian
|
313 |
PROPERTIES FIXTURES_SETUP prepare_shared) |
|
6ea30fb…
|
florian
|
314 |
set_tests_properties( |
|
6ea30fb…
|
florian
|
315 |
minizip_zipping_test_file_shared |
|
6ea30fb…
|
florian
|
316 |
PROPERTIES FIXTURES_REQUIRED prepare_shared FIXTURES_SETUP |
|
6ea30fb…
|
florian
|
317 |
zip_shared) |
|
6ea30fb…
|
florian
|
318 |
set_tests_properties( |
|
6ea30fb…
|
florian
|
319 |
minizip_prepare_shared_unzip |
|
6ea30fb…
|
florian
|
320 |
PROPERTIES FIXTURES_REQUIRED zip_shared FIXTURES_SETUP |
|
6ea30fb…
|
florian
|
321 |
prepare_unzip_shared) |
|
6ea30fb…
|
florian
|
322 |
set_tests_properties( |
|
6ea30fb…
|
florian
|
323 |
minizip_miniunzipping_test_file_shared.zip |
|
6ea30fb…
|
florian
|
324 |
PROPERTIES FIXTURES_REQUIRED prepare_unzip_shared FIXTURES_SETUP |
|
6ea30fb…
|
florian
|
325 |
prepare_compare_shared) |
|
6ea30fb…
|
florian
|
326 |
set_tests_properties( |
|
6ea30fb…
|
florian
|
327 |
minizip_compare_shared |
|
6ea30fb…
|
florian
|
328 |
PROPERTIES FIXTURES_REQUIRED prepare_compare_shared FIXTURES_SETUP |
|
6ea30fb…
|
florian
|
329 |
compared_shared) |
|
6ea30fb…
|
florian
|
330 |
set_tests_properties(minizip_clean_shared_zip |
|
6ea30fb…
|
florian
|
331 |
PROPERTIES FIXTURES_CLEANUP compared_shared) |
|
6ea30fb…
|
florian
|
332 |
endif(MINIZIP_BUILD_SHARED AND NOT ${CMAKE_SHARED_LIBRARY_SUFFIX} STREQUAL |
|
6ea30fb…
|
florian
|
333 |
".dll") |
|
6ea30fb…
|
florian
|
334 |
|
|
6ea30fb…
|
florian
|
335 |
if(MINIZIP_BUILD_STATIC) |
|
6ea30fb…
|
florian
|
336 |
add_test( |
|
6ea30fb…
|
florian
|
337 |
NAME minizip_prepare_static_zip |
|
6ea30fb…
|
florian
|
338 |
COMMAND ${CMAKE_COMMAND} -DCREATE_STATIC=ON -P |
|
6ea30fb…
|
florian
|
339 |
${CMAKE_CURRENT_SOURCE_DIR}/test/test_helper.cm |
|
6ea30fb…
|
florian
|
340 |
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/test) |
|
6ea30fb…
|
florian
|
341 |
add_test( |
|
6ea30fb…
|
florian
|
342 |
NAME minizip_zipping_test_file_static |
|
6ea30fb…
|
florian
|
343 |
COMMAND minizipstatic test_file_static.zip test_file_static.txt |
|
6ea30fb…
|
florian
|
344 |
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/test) |
|
6ea30fb…
|
florian
|
345 |
add_test( |
|
6ea30fb…
|
florian
|
346 |
NAME minizip_prepare_static_unzip |
|
6ea30fb…
|
florian
|
347 |
COMMAND ${CMAKE_COMMAND} -DMOVE_STATIC=ON -P |
|
6ea30fb…
|
florian
|
348 |
${CMAKE_CURRENT_SOURCE_DIR}/test/test_helper.cm |
|
6ea30fb…
|
florian
|
349 |
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/test) |
|
6ea30fb…
|
florian
|
350 |
add_test( |
|
6ea30fb…
|
florian
|
351 |
NAME minizip_miniunzipping_test_file_static.zip |
|
6ea30fb…
|
florian
|
352 |
COMMAND miniunzipstatic test_file_static.zip |
|
6ea30fb…
|
florian
|
353 |
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/test) |
|
6ea30fb…
|
florian
|
354 |
add_test( |
|
6ea30fb…
|
florian
|
355 |
NAME minizip_compare_static |
|
6ea30fb…
|
florian
|
356 |
COMMAND ${CMAKE_COMMAND} -E compare_files test_file_static.txt |
|
6ea30fb…
|
florian
|
357 |
test_file_static.orig |
|
6ea30fb…
|
florian
|
358 |
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/test) |
|
6ea30fb…
|
florian
|
359 |
add_test( |
|
6ea30fb…
|
florian
|
360 |
NAME minizip_clean_static_zip |
|
6ea30fb…
|
florian
|
361 |
COMMAND ${CMAKE_COMMAND} -DDELETE_STATIC=ON -P |
|
6ea30fb…
|
florian
|
362 |
${CMAKE_CURRENT_SOURCE_DIR}/test/test_helper.cm |
|
6ea30fb…
|
florian
|
363 |
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/test) |
|
6ea30fb…
|
florian
|
364 |
set_tests_properties(minizip_prepare_static_zip |
|
6ea30fb…
|
florian
|
365 |
PROPERTIES FIXTURES_SETUP prepare_static) |
|
6ea30fb…
|
florian
|
366 |
set_tests_properties( |
|
6ea30fb…
|
florian
|
367 |
minizip_zipping_test_file_static |
|
6ea30fb…
|
florian
|
368 |
PROPERTIES FIXTURES_REQUIRED prepare_static FIXTURES_SETUP |
|
6ea30fb…
|
florian
|
369 |
zip_static) |
|
6ea30fb…
|
florian
|
370 |
set_tests_properties( |
|
6ea30fb…
|
florian
|
371 |
minizip_prepare_static_unzip |
|
6ea30fb…
|
florian
|
372 |
PROPERTIES FIXTURES_REQUIRED zip_static FIXTURES_SETUP |
|
6ea30fb…
|
florian
|
373 |
prepare_unzip_static) |
|
6ea30fb…
|
florian
|
374 |
set_tests_properties( |
|
6ea30fb…
|
florian
|
375 |
minizip_miniunzipping_test_file_static.zip |
|
6ea30fb…
|
florian
|
376 |
PROPERTIES FIXTURES_REQUIRED prepare_unzip_static FIXTURES_SETUP |
|
6ea30fb…
|
florian
|
377 |
prepare_compare_static) |
|
6ea30fb…
|
florian
|
378 |
set_tests_properties( |
|
6ea30fb…
|
florian
|
379 |
minizip_compare_static |
|
6ea30fb…
|
florian
|
380 |
PROPERTIES FIXTURES_REQUIRED prepare_compare_static FIXTURES_SETUP |
|
6ea30fb…
|
florian
|
381 |
compared_static) |
|
6ea30fb…
|
florian
|
382 |
set_tests_properties(minizip_clean_static_zip |
|
6ea30fb…
|
florian
|
383 |
PROPERTIES FIXTURES_CLEANUP compared_static) |
|
6ea30fb…
|
florian
|
384 |
endif(MINIZIP_BUILD_STATIC) |
|
6ea30fb…
|
florian
|
385 |
|
|
6ea30fb…
|
florian
|
386 |
add_subdirectory(test) |
|
6ea30fb…
|
florian
|
387 |
endif(MINIZIP_BUILD_TESTING) |