"Fossies" - the Fresh Open Source Software Archive

Member "libzip-1.5.2/lib/CMakeLists.txt" (12 Mar 2019, 7408 Bytes) of package /linux/misc/libzip-1.5.2.tar.xz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "CMakeLists.txt": 1.5.1_vs_1.5.2.

    1 INCLUDE(CheckFunctionExists)
    2 
    3 INSTALL(FILES zip.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
    4 
    5 SET(CMAKE_C_VISIBILITY_PRESET hidden)
    6 
    7 # from http://www.cmake.org/Wiki/CMakeMacroLibtoolFile
    8 MACRO(GET_TARGET_PROPERTY_WITH_DEFAULT _variable _target _property _default_value)
    9   GET_TARGET_PROPERTY(${_variable} ${_target} ${_property})
   10   IF(${_variable} STREQUAL NOTFOUND)
   11     SET(${_variable} ${_default_value})
   12   ENDIF()
   13   
   14 ENDMACRO()
   15   
   16 MACRO(CREATE_LIBTOOL_FILE _target _install_DIR)
   17   GET_TARGET_PROPERTY(_target_location ${_target} LOCATION)
   18   GET_TARGET_PROPERTY_WITH_DEFAULT(_target_static_lib ${_target} STATIC_LIB "")
   19   GET_TARGET_PROPERTY_WITH_DEFAULT(_target_dependency_libs ${_target} LT_DEPENDENCY_LIBS "")
   20   GET_TARGET_PROPERTY_WITH_DEFAULT(_target_current ${_target} LT_VERSION_CURRENT 4)
   21   GET_TARGET_PROPERTY_WITH_DEFAULT(_target_revision ${_target} LT_VERSION_REVISION 0)
   22   GET_TARGET_PROPERTY_WITH_DEFAULT(_target_age ${_target} LT_VERSION_AGE 0)
   23   GET_TARGET_PROPERTY_WITH_DEFAULT(_target_installed ${_target} LT_INSTALLED yes)
   24   GET_TARGET_PROPERTY_WITH_DEFAULT(_target_shouldnotlink ${_target} LT_SHOULDNOTLINK yes)
   25   GET_TARGET_PROPERTY_WITH_DEFAULT(_target_dlopen ${_target} LT_DLOPEN "")
   26   GET_TARGET_PROPERTY_WITH_DEFAULT(_target_dlpreopen ${_target} LT_DLPREOPEN "")
   27   GET_FILENAME_COMPONENT(_laname ${_target_location} NAME_WE)
   28   GET_FILENAME_COMPONENT(_soname ${_target_location} NAME)
   29   SET(_laname ${_laname}.la)
   30   FILE(WRITE ${_laname} "# ${_laname} - a libtool library file, generated by cmake \n")
   31   FILE(APPEND ${_laname} "# The name that we can dlopen(3).\n")
   32   FILE(APPEND ${_laname} "dlname='${_soname}'\n")
   33   FILE(APPEND ${_laname} "# Names of this library\n")
   34   FILE(APPEND ${_laname} "library_names='${_soname}.${_target_current}.${_target_age}.${_target_revision} ${_soname}.${_target_current} ${_soname}'\n")
   35   FILE(APPEND ${_laname} "# The name of the static archive\n")
   36   FILE(APPEND ${_laname} "old_library='${_target_static_lib}'\n")
   37   FILE(APPEND ${_laname} "# Libraries that this one depends upon.\n")
   38   FILE(APPEND ${_laname} "dependency_libs='${_target_dependency_libs}'\n")
   39   FILE(APPEND ${_laname} "# Version information.\n")
   40   FILE(APPEND ${_laname} "current=${_target_current}\n")
   41   FILE(APPEND ${_laname} "age=${_target_age}\n")
   42   FILE(APPEND ${_laname} "revision=${_target_revision}\n")
   43   FILE(APPEND ${_laname} "# Is this an already installed library?\n")
   44   FILE(APPEND ${_laname} "installed=${_target_installed}\n")
   45   FILE(APPEND ${_laname} "# Should we warn about portability when linking against -modules?\n")
   46   FILE(APPEND ${_laname} "shouldnotlink=${_target_shouldnotlink}\n")
   47   FILE(APPEND ${_laname} "# Files to dlopen/dlpreopen\n")
   48   FILE(APPEND ${_laname} "dlopen='${_target_dlopen}'\n")
   49   FILE(APPEND ${_laname} "dlpreopen='${_target_dlpreopen}'\n")
   50   FILE(APPEND ${_laname} "# Directory that this library needs to be installed in:\n")
   51   FILE(APPEND ${_laname} "libdir='${CMAKE_INSTALL_PREFIX}/${_install_DIR}'\n")
   52   INSTALL( FILES ${_laname} ${_soname} DESTINATION ${CMAKE_INSTALL_PREFIX}${_install_DIR})
   53 ENDMACRO()
   54  
   55 SET(LIBZIP_SOURCES
   56   zip_add.c
   57   zip_add_dir.c
   58   zip_add_entry.c
   59   zip_algorithm_deflate.c
   60   zip_buffer.c
   61   zip_close.c
   62   zip_delete.c
   63   zip_dir_add.c
   64   zip_dirent.c
   65   zip_discard.c
   66   zip_entry.c
   67   zip_err_str.c
   68   zip_error.c
   69   zip_error_clear.c
   70   zip_error_get.c
   71   zip_error_get_sys_type.c
   72   zip_error_strerror.c
   73   zip_error_to_str.c
   74   zip_extra_field.c
   75   zip_extra_field_api.c
   76   zip_fclose.c
   77   zip_fdopen.c
   78   zip_file_add.c
   79   zip_file_error_clear.c
   80   zip_file_error_get.c
   81   zip_file_get_comment.c
   82   zip_file_get_external_attributes.c
   83   zip_file_get_offset.c
   84   zip_file_rename.c
   85   zip_file_replace.c
   86   zip_file_set_comment.c
   87   zip_file_set_encryption.c
   88   zip_file_set_external_attributes.c
   89   zip_file_set_mtime.c
   90   zip_file_strerror.c
   91   zip_filerange_crc.c
   92   zip_fopen.c
   93   zip_fopen_encrypted.c
   94   zip_fopen_index.c
   95   zip_fopen_index_encrypted.c
   96   zip_fread.c
   97   zip_fseek.c
   98   zip_ftell.c
   99   zip_get_archive_comment.c
  100   zip_get_archive_flag.c
  101   zip_get_encryption_implementation.c
  102   zip_get_file_comment.c
  103   zip_get_name.c
  104   zip_get_num_entries.c
  105   zip_get_num_files.c
  106   zip_hash.c
  107   zip_io_util.c
  108   zip_libzip_version.c
  109   zip_memdup.c
  110   zip_name_locate.c
  111   zip_new.c
  112   zip_open.c
  113   zip_progress.c
  114   zip_rename.c
  115   zip_replace.c
  116   zip_set_archive_comment.c
  117   zip_set_archive_flag.c
  118   zip_set_default_password.c
  119   zip_set_file_comment.c
  120   zip_set_file_compression.c
  121   zip_set_name.c
  122   zip_source_begin_write.c
  123   zip_source_begin_write_cloning.c
  124   zip_source_buffer.c
  125   zip_source_call.c
  126   zip_source_close.c
  127   zip_source_commit_write.c
  128   zip_source_compress.c
  129   zip_source_crc.c
  130   zip_source_error.c
  131   zip_source_filep.c
  132   zip_source_free.c
  133   zip_source_function.c
  134   zip_source_get_compression_flags.c
  135   zip_source_is_deleted.c
  136   zip_source_layered.c
  137   zip_source_open.c
  138   zip_source_pkware.c
  139   zip_source_read.c
  140   zip_source_remove.c
  141   zip_source_rollback_write.c
  142   zip_source_seek.c
  143   zip_source_seek_write.c
  144   zip_source_stat.c
  145   zip_source_supports.c
  146   zip_source_tell.c
  147   zip_source_tell_write.c
  148   zip_source_window.c
  149   zip_source_write.c
  150   zip_source_zip.c
  151   zip_source_zip_new.c
  152   zip_stat.c
  153   zip_stat_index.c
  154   zip_stat_init.c
  155   zip_strerror.c
  156   zip_string.c
  157   zip_unchange.c
  158   zip_unchange_all.c
  159   zip_unchange_archive.c
  160   zip_unchange_data.c
  161   zip_utf-8.c
  162 )
  163 
  164 IF(WIN32)
  165   SET(LIBZIP_OPSYS_FILES
  166     zip_source_win32handle.c
  167     zip_source_win32utf8.c
  168     zip_source_win32w.c
  169   )
  170   IF(CMAKE_SYSTEM_NAME MATCHES WindowsPhone OR CMAKE_SYSTEM_NAME MATCHES WindowsStore)
  171   ELSE()
  172     SET(LIBZIP_OPSYS_FILES "${LIBZIP_OPSYS_FILES}"
  173       zip_source_win32a.c
  174     )
  175   ENDIF()
  176 ELSE(WIN32)
  177   SET(LIBZIP_OPSYS_FILES
  178     zip_source_file.c
  179   )
  180 ENDIF(WIN32)
  181 
  182 INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/..)
  183 
  184 ADD_CUSTOM_TARGET(update_zip_err_str
  185   COMMAND sh ${CMAKE_CURRENT_SOURCE_DIR}/make_zip_err_str.sh ${CMAKE_CURRENT_SOURCE_DIR}/zip.h ${CMAKE_CURRENT_SOURCE_DIR}/zip_err_str.c
  186   DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/zip.h ${CMAKE_CURRENT_SOURCE_DIR}/make_zip_err_str.sh
  187 )
  188 CHECK_FUNCTION_EXISTS(mkstemp HAVE_MKSTEMP)
  189 IF(NOT HAVE_MKSTEMP)
  190   SET(LIBZIP_EXTRA_FILES mkstemp.c)
  191 ENDIF(NOT HAVE_MKSTEMP)
  192 IF(HAVE_LIBBZ2)
  193   SET(LIBZIP_OPTIONAL_FILES zip_algorithm_bzip2.c)
  194 ENDIF()
  195 
  196 IF(HAVE_COMMONCRYPTO)
  197   SET(LIBZIP_OPTIONAL_FILES ${LIBZIP_OPTIONAL_FILES} zip_crypto_commoncrypto.c
  198 )  
  199 ELSEIF(HAVE_WINDOWS_CRYPTO)
  200   SET(LIBZIP_OPTIONAL_FILES ${LIBZIP_OPTIONAL_FILES} zip_crypto_win.c
  201 )
  202 ELSEIF(HAVE_GNUTLS)
  203   SET(LIBZIP_OPTIONAL_FILES ${LIBZIP_OPTIONAL_FILES} zip_crypto_gnutls.c
  204 )
  205 ELSEIF(HAVE_OPENSSL)
  206   SET(LIBZIP_OPTIONAL_FILES ${LIBZIP_OPTIONAL_FILES} zip_crypto_openssl.c
  207 )
  208 ELSEIF(HAVE_MBEDTLS)
  209   SET(LIBZIP_OPTIONAL_FILES ${LIBZIP_OPTIONAL_FILES} zip_crypto_mbedtls.c
  210 )
  211 ENDIF()
  212 
  213 IF(HAVE_CRYPTO)
  214   SET(LIBZIP_OPTIONAL_FILES ${LIBZIP_OPTIONAL_FILES} zip_winzip_aes.c zip_source_winzip_aes_decode.c zip_source_winzip_aes_encode.c
  215 )
  216 ENDIF()
  217 
  218 ADD_LIBRARY(zip ${LIBZIP_SOURCES} ${LIBZIP_EXTRA_FILES} ${LIBZIP_OPTIONAL_FILES} ${LIBZIP_OPSYS_FILES})
  219 
  220 IF(SHARED_LIB_VERSIONNING)
  221 SET_TARGET_PROPERTIES(zip PROPERTIES VERSION 5.0 SOVERSION 5)
  222 ENDIF()
  223 
  224 
  225 TARGET_LINK_LIBRARIES(zip ${ZLIB_LIBRARY} ${OPTIONAL_LIBRARY})
  226 INSTALL(TARGETS zip
  227   RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
  228   ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
  229   LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
  230 #CREATE_LIBTOOL_FILE(zip lib)