diff --git a/ports/libcbor/LibCborConfig.cmake b/ports/libcbor/LibCborConfig.cmake new file mode 100644 index 0000000000..c2fef50868 --- /dev/null +++ b/ports/libcbor/LibCborConfig.cmake @@ -0,0 +1,13 @@ +# Distributed under the OSI-approved BSD 3-Clause License. + +find_path(LIBCBOR_INCLUDE_DIR NAMES cbor.h) + +find_library(LIBCBOR_LIBRARY cbor) + +FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBCBOR DEFAULT_MSG LIBCBOR_LIBRARY LIBCBOR_INCLUDE_DIR) + +if(LIBCBOR_FOUND) + set(LIBCBOR_LIBRARIES ${LIBCBOR_LIBRARY}) +endif() + +mark_as_advanced(LIBCBOR_INCLUDE_DIR LIBCBOR_LIBRARY) diff --git a/ports/libcbor/portfile.cmake b/ports/libcbor/portfile.cmake new file mode 100644 index 0000000000..252a708682 --- /dev/null +++ b/ports/libcbor/portfile.cmake @@ -0,0 +1,29 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO PJK/libcbor + REF v0.8.0 + SHA512 694d2d3a78d80072f96e0afb73590ca1f3572e41d2117330ef4313ed06271743b048d3ba3259c6ffe9a802d5e441379d0e54787d1d42fed08dc81ac4f06c6dbc + HEAD_REF master +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DWITH_TESTS=OFF + -DWITH_EXAMPLES=OFF + -DVCPKG_VERBOSE=ON + ) + +vcpkg_build_cmake() +vcpkg_install_cmake() + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") +vcpkg_copy_pdbs() +vcpkg_fixup_pkgconfig() + +# Add Cmake Packagefile +file(COPY ${CMAKE_CURRENT_LIST_DIR}/LibCborConfig.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) + +# Handle copyright +configure_file(${SOURCE_PATH}/LICENSE.md ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) diff --git a/ports/libcbor/vcpkg.json b/ports/libcbor/vcpkg.json new file mode 100644 index 0000000000..3a546ab351 --- /dev/null +++ b/ports/libcbor/vcpkg.json @@ -0,0 +1,7 @@ +{ + "name": "libcbor", + "version-string": "0.8.0", + "description": "libcbor is a C library for parsing and generating CBOR, the general-purpose schema-less binary data format", + "homepage": "https://github.com/PJK/libcbor", + "supports": "(x86 | x64) & windows" +} diff --git a/versions/baseline.json b/versions/baseline.json index e3aed2d593..f94bcf8221 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -2932,6 +2932,10 @@ "baseline": "1.16.1", "port-version": 2 }, + "libcbor": { + "baseline": "0.8.0", + "port-version": 0 + }, "libcds": { "baseline": "2.3.3", "port-version": 0 diff --git a/versions/l-/libcbor.json b/versions/l-/libcbor.json new file mode 100644 index 0000000000..6e26aa711d --- /dev/null +++ b/versions/l-/libcbor.json @@ -0,0 +1,9 @@ +{ + "versions": [ + { + "git-tree": "ef3f79d600e1f00656e522591c6ff7beed247e3a", + "version-string": "0.8.0", + "port-version": 0 + } + ] +}