comparison libzip/lib/CMakeLists.txt @ 4:2306f4b04790

libzip: import 1.1.2
author David Demelier <markand@malikania.fr>
date Wed, 24 Feb 2016 21:19:28 +0100
parents
children
comparison
equal deleted inserted replaced
3:543b0653ea27 4:2306f4b04790
1 #
2 # CMakeLists.txt -- CMake build system for libzip
3 #
4 # Copyright (c) 2016 David Demelier <markand@malikania.fr>
5 #
6 # Permission to use, copy, modify, and/or distribute this software for any
7 # purpose with or without fee is hereby granted, provided that the above
8 # copyright notice and this permission notice appear in all copies.
9 #
10 # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 #
18
19 set(
20 LIBZIP_SOURCES
21 zip_add.c
22 zip_add_dir.c
23 zip_add_entry.c
24 zip_buffer.c
25 zip_close.c
26 zip_delete.c
27 zip_dir_add.c
28 zip_dirent.c
29 zip_discard.c
30 zip_entry.c
31 zip_err_str.c
32 zip_error.c
33 zip_error_clear.c
34 zip_error_get.c
35 zip_error_get_sys_type.c
36 zip_error_strerror.c
37 zip_error_to_str.c
38 zip_extra_field.c
39 zip_extra_field_api.c
40 zip_fclose.c
41 zip_fdopen.c
42 zip_file_add.c
43 zip_file_error_clear.c
44 zip_file_error_get.c
45 zip_file_get_comment.c
46 zip_file_get_external_attributes.c
47 zip_file_get_offset.c
48 zip_file_rename.c
49 zip_file_replace.c
50 zip_file_set_comment.c
51 zip_file_set_external_attributes.c
52 zip_file_set_mtime.c
53 zip_file_strerror.c
54 zip_filerange_crc.c
55 zip_fopen.c
56 zip_fopen_encrypted.c
57 zip_fopen_index.c
58 zip_fopen_index_encrypted.c
59 zip_fread.c
60 zip_get_archive_comment.c
61 zip_get_archive_flag.c
62 zip_get_compression_implementation.c
63 zip_get_encryption_implementation.c
64 zip_get_file_comment.c
65 zip_get_name.c
66 zip_get_num_entries.c
67 zip_get_num_files.c
68 zip_hash.c
69 zip_io_util.c
70 zip_memdup.c
71 zip_name_locate.c
72 zip_new.c
73 zip_open.c
74 zip_rename.c
75 zip_replace.c
76 zip_set_archive_comment.c
77 zip_set_archive_flag.c
78 zip_set_default_password.c
79 zip_set_file_comment.c
80 zip_set_file_compression.c
81 zip_set_name.c
82 zip_source_begin_write.c
83 zip_source_buffer.c
84 zip_source_call.c
85 zip_source_close.c
86 zip_source_commit_write.c
87 zip_source_crc.c
88 zip_source_deflate.c
89 zip_source_error.c
90 zip_source_filep.c
91 zip_source_free.c
92 zip_source_function.c
93 zip_source_is_deleted.c
94 zip_source_layered.c
95 zip_source_open.c
96 zip_source_pkware.c
97 zip_source_read.c
98 zip_source_remove.c
99 zip_source_rollback_write.c
100 zip_source_seek.c
101 zip_source_seek_write.c
102 zip_source_stat.c
103 zip_source_supports.c
104 zip_source_tell.c
105 zip_source_tell_write.c
106 zip_source_window.c
107 zip_source_write.c
108 zip_source_zip.c
109 zip_source_zip_new.c
110 zip_stat.c
111 zip_stat_index.c
112 zip_stat_init.c
113 zip_strerror.c
114 zip_string.c
115 zip_unchange.c
116 zip_unchange_all.c
117 zip_unchange_archive.c
118 zip_unchange_data.c
119 zip_utf-8.c
120 )
121
122 if (WIN32)
123 set(
124 LIBZIP_OPSYS_FILES
125 zip_source_win32a.c
126 zip_source_win32handle.c
127 zip_source_win32utf8.c
128 zip_source_win32w.c
129 )
130 else ()
131 set(LIBZIP_OPSYS_FILES zip_source_file.c)
132 endif ()
133
134 check_function_exists(mkstemp HAVE_MKSTEMP)
135
136 if (NOT HAVE_MKSTEMP)
137 set(LIBZIP_EXTRA_FILES mkstemp.c)
138 endif ()
139
140 add_library(zip STATIC ${LIBZIP_SOURCES} ${LIBZIP_EXTRA_FILES} ${LIBZIP_OPSYS_FILES})
141 target_link_libraries(zip ${ZLIB_LIBRARY})
142 target_compile_definitions(zip PRIVATE HAVE_CONFIG_H)
143 target_include_directories(
144 zip
145 PUBLIC ${ZLIB_INCLUDE_DIRS}
146 PRIVATE ${libzip_BINARY_DIR}
147 )
148
149 if (MSVC)
150 target_compile_definitions(zip PUBLIC _CRT_SECURE_NO_WARNINGS)
151 endif ()