[hwinfo] add new port (#40637)

Co-authored-by: Jim wang (BEYONDSOFT CONSULTING INC) <v-wangjim@microsoft.com>
Co-authored-by: jim wang <122244446+jimwang118@users.noreply.github.com>
Co-authored-by: honglongyu <honglongyu@sansi.com>
This commit is contained in:
Hlongyu 2024-08-29 15:11:58 +08:00 committed by GitHub
parent 89685cc5d6
commit dfa8003ce7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 64 additions and 0 deletions

View File

@ -0,0 +1,30 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO lfreist/hwinfo
REF 90829612dd4b67356fd643bd9ceee44b04dc8fde
SHA512 9f27c983d8e435c12455001cb7c2a535e9c7d94fec871a8b82d965d41f9a6e739fe4263bb18a66cf50fb826e505cbc0ff6a7c8408a3d74f783f56fefb88110cc
HEAD_REF main
)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" HWINFO_BUILD_SHARED)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" HWINFO_BUILD_STATIC)
vcpkg_cmake_configure(
SOURCE_PATH ${SOURCE_PATH}
OPTIONS
-DBUILD_EXAMPLES=OFF
-DBUILD_TESTING=OFF
-DHWINFO_SHARED=${HWINFO_BUILD_SHARED}
-DHWINFO_STATIC=${HWINFO_BUILD_STATIC}
)
vcpkg_cmake_install()
vcpkg_cmake_config_fixup(
CONFIG_PATH "lib/cmake/hwinfo"
)
vcpkg_copy_pdbs()
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include )
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share )
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")

4
ports/hwinfo/usage Normal file
View File

@ -0,0 +1,4 @@
hwinfo provides CMake targets :
find_package(hwinfo CONFIG REQUIRED)
target_link_libraries(main PRIVATE hwinfo::hwinfo)

17
ports/hwinfo/vcpkg.json Normal file
View File

@ -0,0 +1,17 @@
{
"name": "hwinfo",
"version": "1",
"description": "hwinfo provides an easy-to-use and modern C++ API for retrieving hardware information of your systems components such as CPU, RAM, GPU, Disks, Mainboard, ...",
"homepage": "https://github.com/lfreist/hwinfo",
"supports": "!uwp",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}

View File

@ -3504,6 +3504,10 @@
"baseline": "1.7.2",
"port-version": 1
},
"hwinfo": {
"baseline": "1",
"port-version": 0
},
"hwloc": {
"baseline": "2.10.0",
"port-version": 1

9
versions/h-/hwinfo.json Normal file
View File

@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "a6d2e9185ff6fd053e1762dd85b20549ccaa324d",
"version": "1",
"port-version": 0
}
]
}