Skip to content

Commit

Permalink
[apr] add config for unofficial-apr package, that forwards to APR wit…
Browse files Browse the repository at this point in the history
…h a warning.

* portfile.cmake
  (install): Copy unofficial-apr-config.cmake
* unofficial-apr-config.cmake: New config file for unofficial-apr package, that forwards to apr package and writes a warning.
  • Loading branch information
rinrab committed Aug 31, 2024
1 parent e0e4e79 commit 99cdfe6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ports/apr/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ if (VCPKG_TARGET_IS_WINDOWS)

vcpkg_cmake_install()
vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/apr")
file(
INSTALL "${CMAKE_CURRENT_LIST_DIR}/unofficial-apr-config.cmake"
DESTINATION "${CURRENT_PACKAGES_DIR}/share/unofficial-apr"
)
# There is no way to suppress installation of the headers in debug builds.
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")

Expand Down
11 changes: 11 additions & 0 deletions ports/apr/unofficial-apr-config.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
message(WARNING "find_package(unofficial-apr) is deprecated.\nUse find_package(apr) instead")
include(CMakeFindDependencyMacro)
find_dependency(apr CONFIG)

if("${VCPKG_LIBRARY_LINKAGE}" "static")
add_library(unofficial::apr::apr-1 ALIAS apr::apr-1)
add_library(unofficial::apr::aprapp-1 ALIAS apr::aprapp-1)
else()
add_library(unofficial::apr::libapr-1 ALIAS apr::libapr-1)
add_library(unofficial::apr::libaprapp-1 ALIAS apr::libaprapp-1)
endif()

0 comments on commit 99cdfe6

Please sign in to comment.