portfile.cmake 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. if(EXISTS "${CURRENT_INSTALLED_DIR}/share/libressl/copyright"
  2. OR EXISTS "${CURRENT_INSTALLED_DIR}/share/boringssl/copyright")
  3. message(FATAL_ERROR "Can't build openssl if libressl/boringssl is installed. Please remove libressl/boringssl, and try install openssl again if you need it.")
  4. endif()
  5. if (VCPKG_TARGET_IS_LINUX)
  6. message(WARNING
  7. [[openssl currently requires the following library from the system package manager:
  8. linux-headers
  9. It can be installed on alpine systems via apk add linux-headers.]]
  10. )
  11. endif()
  12. set(OPENSSL_VERSION 3.0.5)
  13. if (VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_UWP)
  14. set(OPENSSL_PATCHES "${CMAKE_CURRENT_LIST_DIR}/windows/flags.patch")
  15. endif()
  16. vcpkg_from_github(
  17. OUT_SOURCE_PATH SOURCE_PATH
  18. REPO openssl/openssl
  19. REF openssl-${OPENSSL_VERSION}
  20. SHA512 e426f2d48dcd87ad938b246cea69988710198c3ed2f5bb9065aa9e74492161b056336f5b1f29be64e70dfd86a77808fe727ebb46eae10331c76f1ff08e341133
  21. PATCHES ${OPENSSL_PATCHES}
  22. )
  23. vcpkg_find_acquire_program(PERL)
  24. get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY)
  25. vcpkg_add_to_path("${PERL_EXE_PATH}")
  26. if(VCPKG_TARGET_IS_UWP)
  27. include("${CMAKE_CURRENT_LIST_DIR}/uwp/portfile.cmake")
  28. include("${CMAKE_CURRENT_LIST_DIR}/install-pc-files.cmake")
  29. elseif(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
  30. include("${CMAKE_CURRENT_LIST_DIR}/windows/portfile.cmake")
  31. include("${CMAKE_CURRENT_LIST_DIR}/install-pc-files.cmake")
  32. else()
  33. include("${CMAKE_CURRENT_LIST_DIR}/unix/portfile.cmake")
  34. endif()
  35. configure_file("${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake.in" "${CURRENT_PACKAGES_DIR}/share/${PORT}/vcpkg-cmake-wrapper.cmake" @ONLY)
  36. file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")