diff options
| author | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
|---|---|---|
| committer | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
| commit | 54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch) | |
| tree | d915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/apr/usage-cmake | |
Diffstat (limited to 'vcpkg/ports/apr/usage-cmake')
| -rw-r--r-- | vcpkg/ports/apr/usage-cmake | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/vcpkg/ports/apr/usage-cmake b/vcpkg/ports/apr/usage-cmake new file mode 100644 index 0000000..0430db5 --- /dev/null +++ b/vcpkg/ports/apr/usage-cmake @@ -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>
+ )
|