mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-24 07:38:59 +08:00
[pbc] Add usage (#27049)
* [pbc] Add usage * x-add-version * fix * x-add-version * update config file * update version
This commit is contained in:
parent
6336644343
commit
13d7255093
@ -1,17 +1,15 @@
|
||||
set(PBC_VERSION 0.5.14)
|
||||
|
||||
if(NOT VCPKG_TARGET_IS_WINDOWS)
|
||||
vcpkg_download_distfile(
|
||||
ARCHIVE
|
||||
URLS "https://crypto.stanford.edu/pbc/files/pbc-${PBC_VERSION}.tar.gz"
|
||||
FILENAME pbc-${PBC_VERSION}.tar.gz
|
||||
URLS "https://crypto.stanford.edu/pbc/files/pbc-${VERSION}.tar.gz"
|
||||
FILENAME pbc-${VERSION}.tar.gz
|
||||
SHA512 d75d4ceb3f67ee62c7ca41e2a91ee914fbffaeb70256675aed6734d586950ea8e64e2f16dc069d71481eddb703624df8d46497005fb58e75cf098dd7e7961333
|
||||
)
|
||||
|
||||
vcpkg_extract_source_archive(
|
||||
SOURCE_PATH
|
||||
ARCHIVE ${ARCHIVE}
|
||||
SOURCE_BASE ${PBC_VERSION}
|
||||
SOURCE_BASE "${VERSION}"
|
||||
PATCHES linux.patch
|
||||
)
|
||||
|
||||
@ -27,7 +25,7 @@ if(NOT VCPKG_TARGET_IS_WINDOWS)
|
||||
set(OPTIONS ${SHARED_STATIC} LEX=${FLEX} YACC=${BISON}\ -y)
|
||||
|
||||
vcpkg_configure_make(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
AUTOCONFIG
|
||||
COPY_SOURCE
|
||||
OPTIONS
|
||||
@ -36,8 +34,8 @@ if(NOT VCPKG_TARGET_IS_WINDOWS)
|
||||
|
||||
vcpkg_install_make()
|
||||
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share ${CURRENT_PACKAGES_DIR}/share/info)
|
||||
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share" "${CURRENT_PACKAGES_DIR}/share/info")
|
||||
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")
|
||||
else()
|
||||
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
|
||||
vcpkg_from_github(
|
||||
@ -105,9 +103,10 @@ else()
|
||||
OPTIONS_DEBUG "/p:RuntimeLibrary=MultiThreadedDebug${RuntimeLibraryExt}"
|
||||
OPTIONS_RELEASE "/p:RuntimeLibrary=MultiThreaded${RuntimeLibraryExt}"
|
||||
OPTIONS /p:SolutionDir=../
|
||||
ALLOW_ROOT_INCLUDES ON
|
||||
ALLOW_ROOT_INCLUDES
|
||||
)
|
||||
|
||||
# clean up mpir stuff
|
||||
file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/mpir.lib ${CURRENT_PACKAGES_DIR}/debug/lib/mpir.lib)
|
||||
file(REMOVE "${CURRENT_PACKAGES_DIR}/lib/mpir.lib" "${CURRENT_PACKAGES_DIR}/debug/lib/mpir.lib")
|
||||
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/unofficial-pbc-config.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/unofficial-${PORT}")
|
||||
endif()
|
||||
|
25
ports/pbc/unofficial-pbc-config.cmake
Normal file
25
ports/pbc/unofficial-pbc-config.cmake
Normal file
@ -0,0 +1,25 @@
|
||||
if(NOT TARGET unofficial::pbc::pbc)
|
||||
get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH)
|
||||
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
|
||||
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
|
||||
|
||||
add_library(unofficial::pbc::pbc UNKNOWN IMPORTED)
|
||||
|
||||
set_target_properties(unofficial::pbc::pbc PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"
|
||||
)
|
||||
|
||||
find_library(PBC_LIBRARY_DEBUG NAMES pbclib libpbc PATHS "${_IMPORT_PREFIX}/debug" PATH_SUFFIXES lib NO_DEFAULT_PATH)
|
||||
if(EXISTS "${PBC_LIBRARY_DEBUG}")
|
||||
set_property(TARGET unofficial::pbc::pbc APPEND PROPERTY IMPORTED_CONFIGURATIONS "Debug")
|
||||
set_target_properties(unofficial::pbc::pbc PROPERTIES IMPORTED_LOCATION_DEBUG "${PBC_LIBRARY_DEBUG}")
|
||||
endif()
|
||||
|
||||
find_library(PBC_LIBRARY_RELEASE NAMES pbclib libpbc PATHS "${_IMPORT_PREFIX}/" PATH_SUFFIXES lib NO_DEFAULT_PATH)
|
||||
if(EXISTS "${PBC_LIBRARY_RELEASE}")
|
||||
set_property(TARGET unofficial::pbc::pbc APPEND PROPERTY IMPORTED_CONFIGURATIONS "Release")
|
||||
set_target_properties(unofficial::pbc::pbc PROPERTIES IMPORTED_LOCATION_RELEASE "${PBC_LIBRARY_RELEASE}")
|
||||
endif()
|
||||
|
||||
unset(_IMPORT_PREFIX)
|
||||
endif()
|
@ -4,6 +4,7 @@
|
||||
"port-version": 7,
|
||||
"description": "Pairing-Based Crypto library provides low-level routines for pairing-based cryptosystems.",
|
||||
"homepage": "https://crypto.stanford.edu/pbc",
|
||||
"license": "LGPL-3.0",
|
||||
"supports": "!uwp & !arm",
|
||||
"dependencies": [
|
||||
{
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "8622a50777b672d1eb2066d3110c8cb503da84ba",
|
||||
"git-tree": "23f4f1804aaa515560fdd3efa19485c9714d2a20",
|
||||
"version": "0.5.14",
|
||||
"port-version": 7
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user