vcpkg/ports/libu2f-server/portfile.cmake
Jack·Boos·Yu 8ead9c2674
[many ports]switch to vcpkg-cmake / vckg-cmake-config part 3 (#29883)
* [many ports]switch to vcpkg-cmake / vckg-cmake-config part 3

* version

* typo

* version

* typo

* version

* Fix params

* version

* deprecated vcpkg_extract_source_archive_ex

* version

* fix arguments

* version

* Rename argument

* version

* Deprecate vcpkg_extract_source_archive_ex

* version

---------

Co-authored-by: jyu49 <yu_jack@apple.com>
2023-03-07 14:14:52 -08:00

35 lines
1.2 KiB
CMake

vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO Yubico/libu2f-server
REF libu2f-server-1.1.0
SHA512 085f8e7d74c1efb347747b8930386f18ba870f668f82e9bd479c9f8431585c5dc7f95b2f6b82bdd3a6de0c06f8cb2fbf51c363ced54255a936ab96536158ee59
HEAD_REF master
PATCHES
windows.patch
strndup-fix.patch
)
file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
file(COPY "${CMAKE_CURRENT_LIST_DIR}/u2f-server-version.h" DESTINATION "${SOURCE_PATH}/u2f-server")
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
)
vcpkg_cmake_install()
# The include file must be patched after the build has completed, because the source files use the wrong subdirectory name!
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/libu2f-server/u2f-server.h"
"#include <u2f-server/u2f-server-version.h>"
"#include <libu2f-server/u2f-server-version.h>"
)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
vcpkg_copy_pdbs()
# Handle copyright
configure_file("${SOURCE_PATH}/COPYING" "${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright" COPYONLY)