mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-27 19:09:00 +08:00
[apr] add usage (#40805)
This commit is contained in:
parent
eba7c6a894
commit
52fa4fb378
@ -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
19
ports/apr/usage-cmake
Normal 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>
|
||||
)
|
@ -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",
|
||||
|
@ -1,5 +1,10 @@
|
||||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "499cf5fc0959f4a049ec72f0f556400e7191ffd3",
|
||||
"version": "1.7.5",
|
||||
"port-version": 1
|
||||
},
|
||||
{
|
||||
"git-tree": "da67695a8735bcfaed89792be1ea44176d9202a3",
|
||||
"version": "1.7.5",
|
||||
|
@ -166,7 +166,7 @@
|
||||
},
|
||||
"apr": {
|
||||
"baseline": "1.7.5",
|
||||
"port-version": 0
|
||||
"port-version": 1
|
||||
},
|
||||
"apr-util": {
|
||||
"baseline": "1.6.3",
|
||||
|
Loading…
Reference in New Issue
Block a user