vcpkg/ports/openssl/portfile.cmake
Vitalii Koshura 1b3a783ff1
[openssl] Fix building in Release only mode (#24004)
* [openssl] Fix building in Release only mode

Signed-off-by: Vitalii Koshura <lestat.de.lionkur@gmail.com>

* Update ports/openssl/windows/portfile.cmake

Co-authored-by: Alexander Neumann <30894796+Neumann-A@users.noreply.github.com>

* Merging from FrankXie05/dev/Frank/23889

Signed-off-by: Vitalii Koshura <lestat.de.lionkur@gmail.com>

Co-authored-by: Alexander Neumann <30894796+Neumann-A@users.noreply.github.com>
2022-04-07 07:48:06 -07:00

39 lines
1.6 KiB
CMake

if(EXISTS "${CURRENT_INSTALLED_DIR}/share/libressl/copyright"
OR EXISTS "${CURRENT_INSTALLED_DIR}/share/boringssl/copyright")
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.")
endif()
if (VCPKG_TARGET_IS_LINUX)
message(WARNING
[[openssl currently requires the following library from the system package manager:
linux-headers
It can be installed on alpine systems via apk add linux-headers.]]
)
endif()
set(OPENSSL_VERSION 3.0.2)
vcpkg_download_distfile(
ARCHIVE
URLS "https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz"
FILENAME "openssl-${OPENSSL_VERSION}.tar.gz"
SHA512 f986850d5be908b4d6b5fd7091bc4652d7378c9bccebfbc5becd7753843c04c1eb61a1749c432139d263dfac33df0b1f6c773664b485cad47542266823a4eb03
)
vcpkg_find_acquire_program(PERL)
get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY)
vcpkg_add_to_path("${PERL_EXE_PATH}")
if(VCPKG_TARGET_IS_UWP)
include("${CMAKE_CURRENT_LIST_DIR}/uwp/portfile.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/install-pc-files.cmake")
elseif(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
include("${CMAKE_CURRENT_LIST_DIR}/windows/portfile.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/install-pc-files.cmake")
else()
include("${CMAKE_CURRENT_LIST_DIR}/unix/portfile.cmake")
endif()
configure_file("${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake.in" "${CURRENT_PACKAGES_DIR}/share/${PORT}/vcpkg-cmake-wrapper.cmake" @ONLY)
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")