[libyaml] Export the pkgconfig files (#21829)

* [libyaml] Export the pkgconfig files

* version

* Fix cmake config file path

* version
This commit is contained in:
Jack·Boos·Yu 2021-12-07 12:38:26 +08:00 committed by GitHub
parent 2d922f46cc
commit 738720268b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 46 additions and 11 deletions

View File

@ -0,0 +1,15 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4f81148..8006536 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -158,3 +158,10 @@ install(
FILES ${config_version_file}
DESTINATION ${INSTALL_CMAKE_DIR} COMPONENT Development
)
+
+set(prefix ${CMAKE_INSTALL_PREFIX})
+set(exec_prefix ${CMAKE_INSTALL_PREFIX})
+set(includedir ${CMAKE_INSTALL_PREFIX}/include)
+set(libdir ${CMAKE_INSTALL_PREFIX}/lib)
+configure_file(yaml-0.1.pc.in ${PROJECT_BINARY_DIR}/yaml-0.1.pc @ONLY)
+install(FILES ${PROJECT_BINARY_DIR}/yaml-0.1.pc DESTINATION lib/pkgconfig)

View File

@ -8,21 +8,26 @@ vcpkg_from_github(
REF 2c891fc7a770e8ba2fec34fc6b545c672beb37e6 # 0.2.5
SHA512 7cdde7b48c937777b851747f7e0b9a74cb7da30173e09305dad931ef83c3fcee3e125e721166690fe6a0987ba897564500530e5518e4b66b1c9b1db8900bf320
HEAD_REF master
PATCHES ${PATCHES}
PATCHES
${PATCHES}
export-pkgconfig.patch
)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DBUILD_TESTING=OFF
-DINSTALL_CMAKE_DIR=share/yaml
)
vcpkg_install_cmake()
vcpkg_cmake_install()
vcpkg_fixup_cmake_targets(CONFIG_PATH share/yaml TARGET_PATH share/yaml)
vcpkg_copy_pdbs()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/include/config.h ${CURRENT_PACKAGES_DIR}/debug/share)
vcpkg_cmake_config_fixup(PACKAGE_NAME yaml CONFIG_PATH share/yaml)
configure_file(${SOURCE_PATH}/License ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY)
vcpkg_fixup_pkgconfig()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/include/config.h" "${CURRENT_PACKAGES_DIR}/debug/share")
configure_file("${SOURCE_PATH}/License" "${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright" COPYONLY)

View File

@ -1,7 +1,17 @@
{
"name": "libyaml",
"version-string": "0.2.5",
"port-version": 1,
"port-version": 2,
"description": "A C library for parsing and emitting YAML.",
"homepage": "https://github.com/yaml/libyaml"
"homepage": "https://github.com/yaml/libyaml",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}

View File

@ -4090,7 +4090,7 @@
},
"libyaml": {
"baseline": "0.2.5",
"port-version": 1
"port-version": 2
},
"libyuv": {
"baseline": "2021-04-15",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "888d62d1f7440f3c9c5ff403e85175372903c0ef",
"version-string": "0.2.5",
"port-version": 2
},
{
"git-tree": "05217bc30337071036997a4d6152165823db9531",
"version-string": "0.2.5",