diff options
| author | Robert Schumacher <roschuma@microsoft.com> | 2017-07-24 10:50:01 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-07-24 10:50:01 -0700 |
| commit | e447dc43ecf68a0210d51ed6057f69fced29a5e5 (patch) | |
| tree | 3c79663fe119219d69cdee4bb86cda31fd5267e5 | |
| parent | e898b5c4c1f5ac82ee620a37d737e819bd8c4d6b (diff) | |
| parent | a3f0d84839caa64c500ceda8095b8da42cd4359a (diff) | |
| download | vcpkg-e447dc43ecf68a0210d51ed6057f69fced29a5e5.tar.gz vcpkg-e447dc43ecf68a0210d51ed6057f69fced29a5e5.zip | |
Merge pull request #1510 from atkawa7/minizip
[minizip] init required by #1369
| -rw-r--r-- | ports/minizip/CMakeLists.txt | 70 | ||||
| -rw-r--r-- | ports/minizip/CONTROL | 4 | ||||
| -rw-r--r-- | ports/minizip/portfile.cmake | 28 |
3 files changed, 102 insertions, 0 deletions
diff --git a/ports/minizip/CMakeLists.txt b/ports/minizip/CMakeLists.txt new file mode 100644 index 000000000..caf2b856d --- /dev/null +++ b/ports/minizip/CMakeLists.txt @@ -0,0 +1,70 @@ +cmake_minimum_required(VERSION 3.8) +project(minizip C) + +if(MSVC) + add_compile_options(/W3 /wd4005 /wd4996 /wd4018 -D_CRT_SECURE_NO_WARNINGS) +endif() + +find_package(ZLIB REQUIRED) + +find_package(Bzip2 REQUIRED) + +set(MIN_SRC contrib/minizip) + +include_directories(${MIN_SRC} ${ZLIB_INCLUDE_DIRS} ${BZIP2_INCLUDE_DIR}) + +set(SRC + ${MIN_SRC}/ioapi.c + ${MIN_SRC}/iowin32.c + ${MIN_SRC}/unzip.c + ${MIN_SRC}/zip.c + ${MIN_SRC}/unzip.c + ${MIN_SRC}/mztools.c +) +set(HEADERS + ${MIN_SRC}/ioapi.h + ${MIN_SRC}/iowin32.h + ${MIN_SRC}/unzip.h + ${MIN_SRC}/zip.h + ${MIN_SRC}/unzip.h + ${MIN_SRC}/mztools.h +) +if(BUILD_SHARED_LIBS) + set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) +endif() + +add_library(minizip ${SRC}) + +target_link_libraries(minizip PRIVATE ZLIB::ZLIB) +target_compile_definitions(minizip PRIVATE -D_ZLIB_H) + +target_link_libraries(minizip PRIVATE ${BZIP2_LIBRARIES}) +target_compile_definitions(minizip PRIVATE -DHAVE_BZIP2=1) + +add_executable(minizip_bin ${MIN_SRC}/minizip.c) +add_executable(miniunz_bin ${MIN_SRC}/miniunz.c) + +target_link_libraries(minizip_bin minizip ${BZIP2_LIBRARIES} ZLIB::ZLIB) +target_link_libraries(miniunz_bin minizip ${BZIP2_LIBRARIES} ZLIB::ZLIB) + +set_target_properties(minizip_bin PROPERTIES OUTPUT_NAME minizip) +set_target_properties(miniunz_bin PROPERTIES OUTPUT_NAME miniunz) + + +install( + TARGETS minizip + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib +) + +if(NOT DISABLE_INSTALL_TOOLS) + install ( + TARGETS minizip_bin miniunz_bin + RUNTIME DESTINATION tools/minizip + ) +endif() + +if(NOT DISABLE_INSTALL_HEADERS) + install(FILES ${HEADERS} DESTINATION include/minizip) +endif() diff --git a/ports/minizip/CONTROL b/ports/minizip/CONTROL new file mode 100644 index 000000000..e4a5daee2 --- /dev/null +++ b/ports/minizip/CONTROL @@ -0,0 +1,4 @@ +Source: minizip +Version: 1.2.11 +Description: +Build-Depends: bzip2, zlib diff --git a/ports/minizip/portfile.cmake b/ports/minizip/portfile.cmake new file mode 100644 index 000000000..c0ed49486 --- /dev/null +++ b/ports/minizip/portfile.cmake @@ -0,0 +1,28 @@ +include(vcpkg_common_functions) + +if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL WindowsStore) + message(FATAL_ERROR "WindowsStore not supported") +endif() + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO madler/zlib + REF v1.2.11 + SHA512 104c62ed1228b5f1199bc037081861576900eb0697a226cafa62a35c4c890b5cb46622e399f9aad82ee5dfb475bae26ae75e2bd6da3d261361b1c8b996970faf + HEAD_REF master +) + +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS_DEBUG -DDISABLE_INSTALL_HEADERS=ON -DDISABLE_INSTALL_TOOLS=ON +) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() + +vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/minizip) + +file(INSTALL ${SOURCE_PATH}/contrib/minizip/MiniZip64_info.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/minizip RENAME copyright) |
