1 INCLUDE(CheckFunctionExists)
3 INSTALL(FILES zip.h DESTINATION include)
5 # from http://www.cmake.org/Wiki/CMakeMacroLibtoolFile
6 MACRO(GET_TARGET_PROPERTY_WITH_DEFAULT _variable _target _property _default_value)
8 GET_TARGET_PROPERTY (${_variable} ${_target} ${_property})
9 IF (${_variable} STREQUAL NOTFOUND)
10 SET (${_variable} ${_default_value})
11 ENDIF (${_variable} STREQUAL NOTFOUND)
13 ENDMACRO (GET_TARGET_PROPERTY_WITH_DEFAULT)
15 MACRO(CREATE_LIBTOOL_FILE _target _install_DIR)
16 GET_TARGET_PROPERTY(_target_location ${_target} LOCATION)
17 GET_TARGET_PROPERTY_WITH_DEFAULT(_target_static_lib ${_target} STATIC_LIB "")
18 GET_TARGET_PROPERTY_WITH_DEFAULT(_target_dependency_libs ${_target} LT_DEPENDENCY_LIBS "")
19 GET_TARGET_PROPERTY_WITH_DEFAULT(_target_current ${_target} LT_VERSION_CURRENT 4)
20 GET_TARGET_PROPERTY_WITH_DEFAULT(_target_revision ${_target} LT_VERSION_REVISION 0)
21 GET_TARGET_PROPERTY_WITH_DEFAULT(_target_age ${_target} LT_VERSION_AGE 0)
22 GET_TARGET_PROPERTY_WITH_DEFAULT(_target_installed ${_target} LT_INSTALLED yes)
23 GET_TARGET_PROPERTY_WITH_DEFAULT(_target_shouldnotlink ${_target} LT_SHOULDNOTLINK yes)
24 GET_TARGET_PROPERTY_WITH_DEFAULT(_target_dlopen ${_target} LT_DLOPEN "")
25 GET_TARGET_PROPERTY_WITH_DEFAULT(_target_dlpreopen ${_target} LT_DLPREOPEN "")
26 GET_FILENAME_COMPONENT(_laname ${_target_location} NAME_WE)
27 GET_FILENAME_COMPONENT(_soname ${_target_location} NAME)
28 SET(_laname ${_laname}.la)
29 FILE(WRITE ${_laname} "# ${_laname} - a libtool library file, generated by cmake \n")
30 FILE(APPEND ${_laname} "# The name that we can dlopen(3).\n")
31 FILE(APPEND ${_laname} "dlname='${_soname}'\n")
32 FILE(APPEND ${_laname} "# Names of this library\n")
33 FILE(APPEND ${_laname} "library_names='${_soname}.${_target_current}.${_target_age}.${_target_revision} ${_soname}.${_target_current} ${_soname}'\n")
34 FILE(APPEND ${_laname} "# The name of the static archive\n")
35 FILE(APPEND ${_laname} "old_library='${_target_static_lib}'\n")
36 FILE(APPEND ${_laname} "# Libraries that this one depends upon.\n")
37 FILE(APPEND ${_laname} "dependency_libs='${_target_dependency_libs}'\n")
38 FILE(APPEND ${_laname} "# Version information.\n")
39 FILE(APPEND ${_laname} "current=${_target_current}\n")
40 FILE(APPEND ${_laname} "age=${_target_age}\n")
41 FILE(APPEND ${_laname} "revision=${_target_revision}\n")
42 FILE(APPEND ${_laname} "# Is this an already installed library?\n")
43 FILE(APPEND ${_laname} "installed=${_target_installed}\n")
44 FILE(APPEND ${_laname} "# Should we warn about portability when linking against -modules?\n")
45 FILE(APPEND ${_laname} "shouldnotlink=${_target_shouldnotlink}\n")
46 FILE(APPEND ${_laname} "# Files to dlopen/dlpreopen\n")
47 FILE(APPEND ${_laname} "dlopen='${_target_dlopen}'\n")
48 FILE(APPEND ${_laname} "dlpreopen='${_target_dlpreopen}'\n")
49 FILE(APPEND ${_laname} "# Directory that this library needs to be installed in:\n")
50 FILE(APPEND ${_laname} "libdir='${CMAKE_INSTALL_PREFIX}/${_install_DIR}'\n")
51 INSTALL( FILES ${_laname} ${_soname}
52 DESTINATION ${CMAKE_INSTALL_PREFIX}${_install_DIR})
53 ENDMACRO(CREATE_LIBTOOL_FILE)
61 zip_algorithm_deflate.c
73 zip_error_get_sys_type.c
81 zip_file_error_clear.c
83 zip_file_get_comment.c
84 zip_file_get_external_attributes.c
88 zip_file_set_comment.c
89 zip_file_set_encryption.c
90 zip_file_set_external_attributes.c
97 zip_fopen_index_encrypted.c
101 zip_get_archive_comment.c
102 zip_get_archive_flag.c
103 zip_get_encryption_implementation.c
104 zip_get_file_comment.c
106 zip_get_num_entries.c
118 zip_set_archive_comment.c
119 zip_set_archive_flag.c
120 zip_set_default_password.c
121 zip_set_file_comment.c
122 zip_set_file_compression.c
124 zip_source_begin_write.c
128 zip_source_commit_write.c
129 zip_source_compress.c
134 zip_source_function.c
135 zip_source_get_compression_flags.c
136 zip_source_is_deleted.c
142 zip_source_rollback_write.c
144 zip_source_seek_write.c
146 zip_source_supports.c
148 zip_source_tell_write.c
150 zip_source_winzip_aes_decode.c
151 zip_source_winzip_aes_encode.c
162 zip_unchange_archive.c
168 SET(LIBZIP_OPSYS_FILES
171 zip_source_win32handle.c
172 zip_source_win32utf8.c
176 SET(LIBZIP_OPSYS_FILES
182 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}
183 ${CMAKE_CURRENT_SOURCE_DIR}/gladman-fcrypt
184 ${CMAKE_CURRENT_BINARY_DIR}/..)
186 # TODO: distribute instead?
187 #ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/zip_err_str.c
188 # COMMAND sh ${CMAKE_CURRENT_SOURCE_DIR}/make_zip_err_str.sh
189 # ${CMAKE_CURRENT_SOURCE_DIR}/zip.h
190 # ${CMAKE_CURRENT_BINARY_DIR}/zip_err_str.c
191 # DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/zip.h
192 # ${CMAKE_CURRENT_SOURCE_DIR}/make_zip_err_str.sh
194 CHECK_FUNCTION_EXISTS(mkstemp HAVE_MKSTEMP)
196 SET(LIBZIP_EXTRA_FILES mkstemp.c)
197 ENDIF(NOT HAVE_MKSTEMP)
199 ADD_LIBRARY(zip ${LIBZIP_SOURCES} ${LIBZIP_EXTRA_FILES} ${LIBZIP_OPSYS_FILES})
200 SET_TARGET_PROPERTIES(zip PROPERTIES VERSION 3.0 SOVERSION 3 )
201 TARGET_LINK_LIBRARIES(zip ${ZLIB_LIBRARY} ${OPTIONAL_LIBRARY})
203 RUNTIME DESTINATION bin
204 ARCHIVE DESTINATION lib
205 LIBRARY DESTINATION lib)
206 #CREATE_LIBTOOL_FILE(zip lib)