Skip to content

Commit

Permalink
[reflectcpp] Add open-source library reflectcpp to vcpkg (#38899)
Browse files Browse the repository at this point in the history
  • Loading branch information
Urfoex authored Nov 28, 2024
1 parent 9ee8c85 commit 65d5e13
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 0 deletions.
35 changes: 35 additions & 0 deletions ports/reflectcpp/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO getml/reflect-cpp
REF "v${VERSION}"
SHA512 755f1474f3c58a950c6db010eeea388a11cf1caca66fbb75b1e03c86794fb3a9c6fa1509e0e78401d31055f43bcaddcd138da06d54e1e3507b2ea08d3a2d05b1
HEAD_REF main
)

if(VCPKG_TARGET_IS_WINDOWS)
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
endif()
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" REFLECTCPP_BUILD_SHARED)

vcpkg_cmake_configure(
SOURCE_PATH ${SOURCE_PATH}
OPTIONS
${FEATURE_OPTIONS}
-DREFLECTCPP_BUILD_TESTS=OFF
-DREFLECTCPP_BUILD_SHARED=${REFLECTCPP_BUILD_SHARED}
-DREFLECTCPP_USE_BUNDLED_DEPENDENCIES=OFF
)

vcpkg_cmake_install()

vcpkg_cmake_config_fixup(
CONFIG_PATH "lib/cmake/${PORT}"
)

file(REMOVE_RECURSE
"${CURRENT_PACKAGES_DIR}/debug/include"
"${CURRENT_PACKAGES_DIR}/debug/share"
)

vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
configure_file("${CMAKE_CURRENT_LIST_DIR}/usage" "${CURRENT_PACKAGES_DIR}/share/${PORT}/usage" COPYONLY)
4 changes: 4 additions & 0 deletions ports/reflectcpp/usage
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
reflect-cpp provides CMake targets:

find_package(reflectcpp CONFIG REQUIRED)
target_link_libraries(main PRIVATE reflectcpp::reflectcpp)
25 changes: 25 additions & 0 deletions ports/reflectcpp/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "reflectcpp",
"version": "0.13.0",
"description": "A C++ library for serialization and deserialization using reflection.",
"homepage": "https://github.com/getml/reflect-cpp/",
"license": "MIT",
"dependencies": [
{
"name": "ctre",
"version>=": "3.9.0"
},
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
},
{
"name": "yyjson",
"version>=": "0.9.0"
}
]
}
4 changes: 4 additions & 0 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -7904,6 +7904,10 @@
"baseline": "0.12.4",
"port-version": 0
},
"reflectcpp": {
"baseline": "0.13.0",
"port-version": 0
},
"refprop-headers": {
"baseline": "2022-12-07",
"port-version": 0
Expand Down
9 changes: 9 additions & 0 deletions versions/r-/reflectcpp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "08d112d4bab3b16cfb10d1af5876dd192448be15",
"version": "0.13.0",
"port-version": 0
}
]
}

0 comments on commit 65d5e13

Please sign in to comment.