Skip to content

Commit

Permalink
vcpkg.json: remove baseline
Browse files Browse the repository at this point in the history
Use VCPKG_OVERLAY_PORTS overlay openssl 1.1
  • Loading branch information
KangLin committed Mar 17, 2024
1 parent 194676f commit 6f7dfec
Show file tree
Hide file tree
Showing 17 changed files with 1,325 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ jobs:
7z a FaceRecognizer_${{env.FaceRecognizer_VERSION}}_macos_qt${{matrix.qt_version}}.zip ./install/*
- name: Update artifact
if: ${{ matrix.BUILD_TYPE == 'Release' }}
if: ${{ matrix.BUILD_TYPE == 'Release' && matrix.qt_version == '6.6.2' }}
uses: actions/upload-artifact@v3
with:
name: ${{ env.artifact_name }}
Expand Down
274 changes: 274 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,274 @@
{
"version": 7,

"cmakeMinimumRequired": {
"major": 3,
"minor": 27,
"patch": 0
},

"configurePresets": [
{
"name": "vcpkg",
"description": "Configure with vcpkg. please set VCPKG_ROOT environment first",
"hidden": true,
"cacheVariables": {
"CMAKE_TOOLCHAIN_FILE": {
"value": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake",
"type": "FILEPATH"
},
"VCPKG_VERBOSE": "ON",
"X_VCPKG_APPLOCAL_DEPS_INSTALL": "ON"
}
},
{
"name": "base",
"hidden": true,
"inherits": "vcpkg",
"cacheVariables": {
"BUILD_FREERDP": "ON",
"CMARK_SHARED": "OFF",
"CMARK_TESTS": "OFF",
"CMARK_STATIC": "ON",
"CMAKE_BUILD_TYPE": "Release"
}
},
{
"name": "openssl1.1",
"description": "Versions earlier than QT6.5 use OpenSSL 1.1",
"hidden": true,
"cacheVariables": {
"VCPKG_OVERLAY_PORTS": {
"value": "${sourceDir}/vcpkg/ports",
"type": "FILEPATH"
}
}
},

{
"name": "qt6",
"inherits": [
"base"
],
"cacheVariables": {
"QT_ROOT": {
"value": "$env{Qt6_DIR}",
"type": "PATH"
},
"Qt6_DIR": {
"value": "$env{Qt6_DIR}",
"type": "PATH"
}
}
},
{
"name": "qt5",
"description": "Versions earlier than QT6.5 use OpenSSL 1.1",
"inherits": [
"base",
"openssl1.1"
],
"cacheVariables": {
"QT_ROOT": {
"value": "$env{Qt5_DIR}",
"type": "PATH"
},
"Qt5_DIR": {
"value": "$env{Qt5_DIR}",
"type": "PATH"
}
}
},

{
"name": "x64",
"hidden": true,
"binaryDir": "build/x64",
"architecture": {
"value": "x64"
}
},
{
"name": "x86",
"hidden": true,
"binaryDir": "build/x86",
"architecture": {
"value": "Win32"
}
},

{
"name": "msvc",
"hidden": true,
"generator": "Visual Studio 17 2022",
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Windows"
}
},
{
"name": "msvc-x64-qt6",
"inherits": [
"msvc",
"qt6",
"x64"
]
},
{
"name": "msvc-x86-qt6",
"inherits": [
"msvc",
"qt6",
"x86"
]
},
{
"name": "msvc-x64-qt5",
"inherits": [
"msvc",
"qt5",
"x64"
]
},
{
"name": "msvc-x86-qt5",
"inherits": [
"msvc",
"qt5",
"x86"
]
},

{
"name": "ninja",
"hidden": true,
"generator": "Ninja"
},
{
"name": "ninja-x64-qt6",
"inherits": [
"ninja",
"qt6",
"x64"
]
},
{
"name": "ninja-x86-qt6",
"inherits": [
"ninja",
"qt6",
"x86"
]
},
{
"name": "ninja-x64-qt5",
"inherits": [
"ninja",
"qt5",
"x64"
]
},
{
"name": "ninja-x86-qt5",
"inherits": [
"ninja",
"qt5",
"x86"
]
}
],

"buildPresets": [
{
"name": "msvc-x64-qt6",
"configurePreset": "msvc-x64-qt6",
"configuration": "Release",
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Windows"
}
},
{
"name": "msvc-x86-qt6",
"configurePreset": "msvc-x86-qt6",
"configuration": "Release",
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Windows"
}
},
{
"name": "msvc-x64-qt5",
"configurePreset": "msvc-x64-qt5",
"configuration": "Release",
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Windows"
}
},
{
"name": "msvc-x86-qt5",
"configurePreset": "msvc-x86-qt5",
"configuration": "Release",
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Windows"
}
},

{
"name": "ninja-x64-qt6",
"configurePreset": "ninja-x64-qt6",
"configuration": "Release"
},
{
"name": "ninja-x86-qt6",
"configurePreset": "ninja-x86-qt6",
"configuration": "Release"
},
{
"name": "ninja-x64-qt5",
"configurePreset": "ninja-x64-qt5",
"configuration": "Release"
},
{
"name": "ninja-x86-qt5",
"configurePreset": "ninja-x86-qt5",
"configuration": "Release"
}
],

"workflowPresets": [
{
"name": "msvc-x64-qt6",
"steps": [
{
"type": "configure",
"name": "msvc-x64-qt6"
},
{
"type": "build",
"name": "msvc-x64-qt6"
}
]
},
{
"name": "msvc-x86-qt6",
"steps": [
{
"type": "configure",
"name": "msvc-x86-qt6"
},
{
"type": "build",
"name": "msvc-x86-qt6"
}
]
}
]
}
7 changes: 1 addition & 6 deletions vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,5 @@
"dlib"
]
}
},

"builtin-baseline":"9259a0719d94c402aae2ab7975bc096afdec15df",
"overrides": [
{ "name": "openssl", "version-string": "1.1.1n" }
]
}
}
32 changes: 32 additions & 0 deletions vcpkg/ports/openssl/install-pc-files.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
function(install_pc_file name pc_data)
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
configure_file("${CMAKE_CURRENT_LIST_DIR}/openssl.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/${name}.pc" @ONLY)
endif()
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
configure_file("${CMAKE_CURRENT_LIST_DIR}/openssl.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/${name}.pc" @ONLY)
endif()
endfunction()

install_pc_file(openssl [[
Name: OpenSSL
Description: Secure Sockets Layer and cryptography libraries and tools
Requires: libssl libcrypto
]])

install_pc_file(libssl [[
Name: OpenSSL-libssl
Description: Secure Sockets Layer and cryptography libraries
Libs: -L"${libdir}" -llibssl
Requires: libcrypto
Cflags: -I"${includedir}"
]])

install_pc_file(libcrypto [[
Name: OpenSSL-libcrypto
Description: OpenSSL cryptography library
Libs: -L"${libdir}" -llibcrypto
Libs.private: -lcrypt32 -lws2_32
Cflags: -I"${includedir}"
]])

vcpkg_fixup_pkgconfig()
6 changes: 6 additions & 0 deletions vcpkg/ports/openssl/openssl.pc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
prefix=${pcfiledir}/../..
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
Version: @OPENSSL_VERSION@
@pc_data@
28 changes: 28 additions & 0 deletions vcpkg/ports/openssl/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
if(EXISTS "${CURRENT_INSTALLED_DIR}/include/openssl/ssl.h")
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()

set(OPENSSL_VERSION 1.1.1n)
vcpkg_download_distfile(
ARCHIVE
URLS "https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz" "https://www.openssl.org/source/old/1.1.1/openssl-${OPENSSL_VERSION}.tar.gz"
FILENAME "openssl-${OPENSSL_VERSION}.tar.gz"
SHA512 1937796736613dcf4105a54e42ecb61f95a1cea74677156f9459aea0f2c95159359e766089632bf364ee6b0d28d661eb9957bce8fecc9d2436378d8d79e8d0a4
)

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}")
Loading

0 comments on commit 6f7dfec

Please sign in to comment.