forked from microsoft/vcpkg
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathusage-cmake
More file actions
19 lines (14 loc) · 744 Bytes
/
Copy pathusage-cmake
File metadata and controls
19 lines (14 loc) · 744 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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>
)