mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-05 07:59:01 +08:00
407bc79b39
* Create package openssl3 * Create package openssl3 * Delete openssl3 * update version to 3.0.1 * Delete openssl3 * Update manifests to 3.0.1 * Fix download url * Update port version * Update version * Remove wrong port version * Fix errors * Fix license * Remove empty folders * Fix post-build errors * Add license field * Fix cmake for uwp * Remove patch file * format manifest * Update version file * Fix port version * version * Test: remove vcvarsall * version * fix version * version * Fix docs in cmake files as well * wrong branch * Add port openssl-1 * Fix directories * delete openssl-1 * [openssl-1] Add port * version * Fix UWP build * version * migrate uthenticode * version * Fix UWP build for librabbitmq * version * Fix UWP warnings * version * Fix patch * version * Disable C4996 on UWP * version * [idevicerestore] disable C4996 * remove warning fixes * Revert uthenticode * Final newlines * version * Remove winsock replace * version * [libwebsockets] Disable /WX on Windows * version * Typo * version * Disable C4996 in patch instead * version * [luasec] Use openssl-1 * version * revert luasec * migrate luasec * version * revert winsock * version * revert winsock * version * revert revert * version * Fix platform for luasec * Fix supports * version * . * version * uthenticode * libmysql * azure-c-shared-utility * version * remove azure-c-shared-utility * revert all * uthenticode * version * azure * version * libmysql * version * remove mysql * [libdatachannel] disable warnings on UWP * version * Fix patches * version * Add openssl-1 to CI baseline * openssl-1: check if copyright exists * version * revert azure * [libssh2] disable c4996 * version * [aws-sdk-cpp] -Wno-deprecated * version * fix aws patch * version * fix aws patch * version * [qpid-proton] disable warning * version * Fix patch * version * [librtmp] disable c4996 * version * [libu2f-server] disablec4996 * switch version scheme * version * [idevicerestore] disable c4996 * version * typo * version * fix cmake * version * fix cmake again * version * [uthenticode] patch to support Openssl 3 * version * fix idevicerestore * version * search for conflicting copyrights * version * Fix luasec * fix version * version * fix azure * version * Remove debug stuff * version * [open62541] patch * update port version * version * [libmysql] patch * version * Fix patch * version * Format openssl * Format openssl portfiles * Check for conflicting copyrights * Fix typo * Rename openssl-1 to openssl1 * Rename openssl-1 to openssl1 * version * Update ci baseline * version * resolve conflicting port versions * version * apply latest openssl security fix * version * Fix qpid-proton * version * retrigger Bbuild of qtbase * version * revert qtbase * Remove openssl1 * version * version * fix openssl_version_fix Co-authored-by: nicole mazzuca <mazzucan@outlook.com>
83 lines
3.1 KiB
CMake
83 lines
3.1 KiB
CMake
cmake_policy(PUSH)
|
|
cmake_policy(SET CMP0012 NEW)
|
|
cmake_policy(SET CMP0054 NEW)
|
|
cmake_policy(SET CMP0057 NEW)
|
|
|
|
set(OPENSSL_VERSION_MAJOR 3)
|
|
set(OPENSSL_VERSION_MINOR 0)
|
|
set(OPENSSL_VERSION_FIX 2)
|
|
|
|
if(OPENSSL_USE_STATIC_LIBS)
|
|
if("@VCPKG_LIBRARY_LINKAGE@" STREQUAL "dynamic")
|
|
message(WARNING "OPENSSL_USE_STATIC_LIBS is set, but vcpkg port openssl was built with dynamic linkage")
|
|
endif()
|
|
set(OPENSSL_USE_STATIC_LIBS_BAK "${OPENSSL_USE_STATIC_LIBS}")
|
|
set(OPENSSL_USE_STATIC_LIBS FALSE)
|
|
endif()
|
|
|
|
if(DEFINED OPENSSL_ROOT_DIR)
|
|
set(OPENSSL_ROOT_DIR_BAK "${OPENSSL_ROOT_DIR}")
|
|
endif()
|
|
get_filename_component(OPENSSL_ROOT_DIR "${CMAKE_CURRENT_LIST_DIR}" DIRECTORY)
|
|
get_filename_component(OPENSSL_ROOT_DIR "${OPENSSL_ROOT_DIR}" DIRECTORY)
|
|
find_path(OPENSSL_INCLUDE_DIR NAMES openssl/ssl.h PATH "${OPENSSL_ROOT_DIR}/include" NO_DEFAULT_PATH)
|
|
if(MSVC)
|
|
find_library(LIB_EAY_DEBUG NAMES libcrypto PATHS "${OPENSSL_ROOT_DIR}/debug/lib" NO_DEFAULT_PATH)
|
|
find_library(LIB_EAY_RELEASE NAMES libcrypto PATHS "${OPENSSL_ROOT_DIR}/lib" NO_DEFAULT_PATH)
|
|
find_library(SSL_EAY_DEBUG NAMES libssl PATHS "${OPENSSL_ROOT_DIR}/debug/lib" NO_DEFAULT_PATH)
|
|
find_library(SSL_EAY_RELEASE NAMES libssl PATHS "${OPENSSL_ROOT_DIR}/lib" NO_DEFAULT_PATH)
|
|
elseif(WIN32)
|
|
find_library(LIB_EAY NAMES libcrypto crypto NAMES_PER_DIR)
|
|
find_library(SSL_EAY NAMES libssl ssl NAMES_PER_DIR)
|
|
else()
|
|
find_library(OPENSSL_CRYPTO_LIBRARY NAMES crypto)
|
|
find_library(OPENSSL_SSL_LIBRARY NAMES ssl)
|
|
endif()
|
|
|
|
_find_package(${ARGS})
|
|
|
|
unset(OPENSSL_ROOT_DIR)
|
|
if(DEFINED OPENSSL_ROOT_DIR_BAK)
|
|
set(OPENSSL_ROOT_DIR "${OPENSSL_ROOT_DIR_BAK}")
|
|
unset(OPENSSL_ROOT_DIR_BAK)
|
|
endif()
|
|
|
|
if(DEFINED OPENSSL_USE_STATIC_LIBS_BAK)
|
|
set(OPENSSL_USE_STATIC_LIBS "${OPENSSL_USE_STATIC_LIBS_BAK}")
|
|
unset(OPENSSL_USE_STATIC_LIBS_BAK)
|
|
endif()
|
|
|
|
if(OPENSSL_FOUND AND "@VCPKG_LIBRARY_LINKAGE@" STREQUAL "static")
|
|
if(WIN32)
|
|
list(APPEND OPENSSL_LIBRARIES crypt32 ws2_32)
|
|
if(TARGET OpenSSL::Crypto)
|
|
set_property(TARGET OpenSSL::Crypto APPEND PROPERTY INTERFACE_LINK_LIBRARIES "crypt32;ws2_32")
|
|
endif()
|
|
if(TARGET OpenSSL::SSL)
|
|
set_property(TARGET OpenSSL::SSL APPEND PROPERTY INTERFACE_LINK_LIBRARIES "crypt32;ws2_32")
|
|
endif()
|
|
else()
|
|
find_library(OPENSSL_DL_LIBRARY NAMES dl)
|
|
if(OPENSSL_DL_LIBRARY)
|
|
list(APPEND OPENSSL_LIBRARIES "dl")
|
|
if(TARGET OpenSSL::Crypto)
|
|
set_property(TARGET OpenSSL::Crypto APPEND PROPERTY INTERFACE_LINK_LIBRARIES "dl")
|
|
endif()
|
|
endif()
|
|
|
|
if("REQUIRED" IN_LIST ARGS)
|
|
find_package(Threads REQUIRED)
|
|
else()
|
|
find_package(Threads)
|
|
endif()
|
|
list(APPEND OPENSSL_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
|
|
if(TARGET OpenSSL::Crypto)
|
|
set_property(TARGET OpenSSL::Crypto APPEND PROPERTY INTERFACE_LINK_LIBRARIES "Threads::Threads")
|
|
endif()
|
|
if(TARGET OpenSSL::SSL)
|
|
set_property(TARGET OpenSSL::SSL APPEND PROPERTY INTERFACE_LINK_LIBRARIES "Threads::Threads")
|
|
endif()
|
|
endif()
|
|
endif()
|
|
cmake_policy(POP)
|