forked from microsoft/vcpkg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvcpkg-cmake-wrapper.cmake
93 lines (84 loc) · 1.96 KB
/
vcpkg-cmake-wrapper.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
find_path(
ALSA_INCLUDE_DIR
NAMES alsa/asoundlib.h
PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include"
NO_DEFAULT_PATH
)
find_library(
ALSA_LIBRARY_DEBUG
NAMES asound
PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib"
NO_DEFAULT_PATH
)
find_library(
ALSA_LIBRARY_RELEASE
NAMES asound
PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib"
NO_DEFAULT_PATH
)
include(SelectLibraryConfigurations)
select_library_configurations(ALSA)
unset(ALSA_FOUND)
set(ALSA_LIBRARY "${ALSA_LIBRARY}" CACHE INTERNAL "")
_find_package(${ARGS})
if(TARGET ALSA::ALSA)
if(ALSA_LIBRARY_DEBUG)
set_property(
TARGET ALSA::ALSA
APPEND
PROPERTY IMPORTED_CONFIGURATIONS DEBUG
)
set_target_properties(
ALSA::ALSA
PROPERTIES
IMPORTED_LOCATION_DEBUG "${ALSA_LIBRARY_DEBUG}"
)
endif()
if(ALSA_LIBRARY_RELEASE)
set_property(
TARGET ALSA::ALSA
APPEND
PROPERTY IMPORTED_CONFIGURATIONS RELEASE
)
set_target_properties(
ALSA::ALSA
PROPERTIES
IMPORTED_LOCATION_RELEASE "${ALSA_LIBRARY_RELEASE}"
)
endif()
find_library(Z_VCPKG_HAS_LIBM NAMES m)
if(Z_VCPKG_HAS_LIBM)
list(APPEND ALSA_LIBRARIES m)
set_property(
TARGET ALSA::ALSA
APPEND
PROPERTY INTERFACE_LINK_LIBRARIES m
)
endif()
if(CMAKE_DL_LIBS)
list(APPEND ALSA_LIBRARIES ${CMAKE_DL_LIBS})
set_property(
TARGET ALSA::ALSA
APPEND
PROPERTY INTERFACE_LINK_LIBRARIES ${CMAKE_DL_LIBS}
)
endif()
find_package(Threads)
if(TARGET Threads::Threads)
list(APPEND ALSA_LIBRARIES Threads::Threads)
set_property(
TARGET ALSA::ALSA
APPEND
PROPERTY INTERFACE_LINK_LIBRARIES Threads::Threads
)
endif()
find_library(Z_VCPKG_HAS_LIBRT NAMES rt)
if(Z_VCPKG_HAS_LIBRT)
list(APPEND ALSA_LIBRARIES rt)
set_property(
TARGET ALSA::ALSA
APPEND
PROPERTY INTERFACE_LINK_LIBRARIES rt
)
endif()
endif()