mirror of
https://github.com/microsoft/vcpkg.git
synced 2025-01-18 09:43:02 +08:00
[openssl] Refactor portfile-CMakeLists.txt interaction to allow proper application of patches
This commit is contained in:
parent
75d304009a
commit
129a3ec8b2
@ -2,25 +2,16 @@ cmake_minimum_required(VERSION 3.0)
|
||||
project(openssl NONE)
|
||||
|
||||
include(vcpkg_execute_required_process)
|
||||
include(vcpkg_apply_patches)
|
||||
set(SOURCE_PATH ${CMAKE_CURRENT_BINARY_DIR}/openssl-${OPENSSL_VERSION})
|
||||
|
||||
find_program(PERL perl)
|
||||
find_program(NMAKE nmake)
|
||||
|
||||
message(STATUS "Extracting source ${OPENSSL_SOURCE_ARCHIVE}")
|
||||
vcpkg_execute_required_process(
|
||||
COMMAND ${CMAKE_COMMAND} -E tar xjf "${OPENSSL_SOURCE_ARCHIVE}"
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
LOGNAME extract-${TARGET_TRIPLET}-rel
|
||||
)
|
||||
|
||||
vcpkg_apply_patches(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PATCHES ${CMAKE_CURRENT_LIST_DIR}/PerlScriptSpaceInPathFixes.patch
|
||||
${CMAKE_CURRENT_LIST_DIR}/ConfigureIncludeQuotesFix.patch
|
||||
${CMAKE_CURRENT_LIST_DIR}/STRINGIFYPatch.patch
|
||||
)
|
||||
if(CMAKE_BUILD_TYPE MATCHES "Debug")
|
||||
file(COPY ${OPENSSL_SOURCE_MASTER_COPY} DESTINATION ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg)
|
||||
else()
|
||||
file(COPY ${OPENSSL_SOURCE_MASTER_COPY} DESTINATION ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel)
|
||||
endif()
|
||||
|
||||
set(CONFIGURE_COMMAND ${PERL} Configure
|
||||
enable-static-engine
|
||||
@ -45,7 +36,6 @@ if(CMAKE_BUILD_TYPE MATCHES "Debug")
|
||||
debug-${OPENSSL_ARCH}
|
||||
"--prefix=${OPENSSLDIR}"
|
||||
"--openssldir=${OPENSSLDIR}"
|
||||
|
||||
)
|
||||
else()
|
||||
set(OPENSSLDIR ${CURRENT_PACKAGES_DIR})
|
||||
|
@ -18,13 +18,15 @@ vcpkg_download_distfile(OPENSSL_SOURCE_ARCHIVE
|
||||
SHA512 0d314b42352f4b1df2c40ca1094abc7e9ad684c5c35ea997efdd58204c70f22a1abcb17291820f0fff3769620a4e06906034203d31eb1a4d540df3e0db294016
|
||||
)
|
||||
|
||||
file(COPY
|
||||
${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_LIST_DIR}/PerlScriptSpaceInPathFixes.patch
|
||||
${CMAKE_CURRENT_LIST_DIR}/ConfigureIncludeQuotesFix.patch
|
||||
${CMAKE_CURRENT_LIST_DIR}/STRINGIFYPatch.patch
|
||||
DESTINATION ${SOURCE_PATH})
|
||||
vcpkg_extract_source_archive(${OPENSSL_SOURCE_ARCHIVE})
|
||||
vcpkg_apply_patches(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PATCHES ${CMAKE_CURRENT_LIST_DIR}/PerlScriptSpaceInPathFixes.patch
|
||||
${CMAKE_CURRENT_LIST_DIR}/ConfigureIncludeQuotesFix.patch
|
||||
${CMAKE_CURRENT_LIST_DIR}/STRINGIFYPatch.patch
|
||||
)
|
||||
|
||||
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
|
||||
vcpkg_configure_cmake(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
GENERATOR "NMake Makefiles"
|
||||
@ -32,7 +34,7 @@ vcpkg_configure_cmake(
|
||||
-DCURRENT_INSTALLED_DIR=${CURRENT_INSTALLED_DIR}
|
||||
-DCURRENT_PACKAGES_DIR=${CURRENT_PACKAGES_DIR}
|
||||
-DCURRENT_BUILDTREES_DIR=${CURRENT_BUILDTREES_DIR}
|
||||
-DOPENSSL_SOURCE_ARCHIVE=${OPENSSL_SOURCE_ARCHIVE}
|
||||
-DOPENSSL_SOURCE_MASTER_COPY=${SOURCE_PATH}
|
||||
-DCMAKE_MODULE_PATH=${CMAKE_MODULE_PATH}
|
||||
-DTRIPLET_SYSTEM_ARCH=${TRIPLET_SYSTEM_ARCH}
|
||||
-DOPENSSL_VERSION=${OPENSSL_VERSION}
|
||||
|
Loading…
Reference in New Issue
Block a user