[apr] add usage (#40805)

This commit is contained in:
Timofei Zhakov 2024-09-10 05:22:46 +02:00 committed by GitHub
parent eba7c6a894
commit 52fa4fb378
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 28 additions and 1 deletions

View File

@ -44,6 +44,8 @@ if (VCPKG_TARGET_IS_WINDOWS)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
vcpkg_copy_pdbs()
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage-cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME usage)
else()
# To cross-compile you will need a triplet file that locates the tool chain and sets --host and --cache parameters of "./configure".
# The ${VCPKG_PLATFORM_TOOLSET}.cache file must have been generated on the targeted host using "./configure -C".

19
ports/apr/usage-cmake Normal file
View File

@ -0,0 +1,19 @@
APR provides CMake targets whose names will start with the 'lib' prefix in shared configurations, while static configurations will not:
find_package(apr CONFIG REQUIRED)
# Use the shared configuration
target_link_libraries(main PRIVATE apr::apr-1 apr::libaprapp-1)
# Use the static configuration
target_link_libraries(main PRIVATE apr::apr-1 apr::aprapp-1)
To ensure compatibility with both static and shared configurations:
find_package(apr CONFIG REQUIRED)
target_link_libraries(main PRIVATE
$<$<TARGET_EXISTS:apr::apr-1>:apr::apr-1>
$<$<TARGET_EXISTS:apr::aprapp-1>:apr::aprapp-1>
$<$<TARGET_EXISTS:apr::libapr-1>:apr::libapr-1>
$<$<TARGET_EXISTS:apr::libaprapp-1>:apr::libaprapp-1>
)

View File

@ -1,6 +1,7 @@
{
"name": "apr",
"version": "1.7.5",
"port-version": 1,
"description": "The Apache Portable Runtime (APR) is a C library that forms a system portability layer that covers many operating systems.",
"homepage": "https://apr.apache.org/",
"license": "Apache-2.0",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "499cf5fc0959f4a049ec72f0f556400e7191ffd3",
"version": "1.7.5",
"port-version": 1
},
{
"git-tree": "da67695a8735bcfaed89792be1ea44176d9202a3",
"version": "1.7.5",

View File

@ -166,7 +166,7 @@
},
"apr": {
"baseline": "1.7.5",
"port-version": 0
"port-version": 1
},
"apr-util": {
"baseline": "1.6.3",