1
0

portfile.cmake 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. # When this port is updated, the minizip port should be updated at the same time
  2. vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
  3. vcpkg_from_github(
  4. OUT_SOURCE_PATH SOURCE_PATH
  5. REPO madler/zlib
  6. REF v1.2.13
  7. SHA512 44b834fbfb50cca229209b8dbe1f96b258f19a49f5df23b80970b716371d856a4adf525edb4c6e0e645b180ea949cb90f5365a1d896160f297f56794dd888659
  8. HEAD_REF master
  9. PATCHES
  10. 0001-remove-ifndef-NOUNCRYPT.patch
  11. 0002-add-declaration-for-mkdir.patch
  12. 0003-no-io64.patch
  13. )
  14. vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
  15. FEATURES
  16. bzip2 ENABLE_BZIP2
  17. )
  18. configure_file("${CMAKE_CURRENT_LIST_DIR}/minizipConfig.cmake.in" "${SOURCE_PATH}/cmake/minizipConfig.cmake.in" COPYONLY)
  19. configure_file("${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" "${SOURCE_PATH}/CMakeLists.txt" COPYONLY)
  20. vcpkg_cmake_configure(
  21. SOURCE_PATH "${SOURCE_PATH}"
  22. OPTIONS
  23. ${FEATURE_OPTIONS}
  24. -DDISABLE_INSTALL_TOOLS=${VCPKG_TARGET_IS_IOS}
  25. OPTIONS_DEBUG
  26. -DDISABLE_INSTALL_HEADERS=ON
  27. )
  28. vcpkg_cmake_install()
  29. vcpkg_copy_pdbs()
  30. vcpkg_cmake_config_fixup()
  31. vcpkg_copy_tool_dependencies("${CURRENT_PACKAGES_DIR}/tools/minizip")
  32. if ("bzip2" IN_LIST FEATURES)
  33. file(GLOB HEADERS "${CURRENT_PACKAGES_DIR}/include/minizip/*.h")
  34. foreach(HEADER ${HEADERS})
  35. file(READ "${HEADER}" _contents)
  36. string(REPLACE "#ifdef HAVE_BZIP2" "#if 1" _contents "${_contents}")
  37. file(WRITE "${HEADER}" "${_contents}")
  38. endforeach()
  39. endif()
  40. file(COPY "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
  41. file(INSTALL "${SOURCE_PATH}/contrib/minizip/MiniZip64_info.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)