2023-04-19 07:38:48 +08:00
|
|
|
set(PATCHES fix-for-vcpkg.patch)
|
2022-04-07 02:04:46 +08:00
|
|
|
|
|
|
|
if(VCPKG_TARGET_IS_UWP)
|
|
|
|
list(APPEND PATCHES uwp-warnings.patch)
|
|
|
|
endif()
|
|
|
|
|
2020-11-24 02:50:37 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO paullouisageneau/libdatachannel
|
2023-02-10 02:46:01 +08:00
|
|
|
REF "v${VERSION}"
|
2024-06-07 17:23:19 +08:00
|
|
|
SHA512 67119f6d1280593696f71dc550ceba1076066d0f55ebf10b527bf1c75e5e9571be18e5d9732e43a2aa4d5106a49a0676e70938d35d3eb4005cf17612f8836c52
|
2020-11-24 02:50:37 +08:00
|
|
|
HEAD_REF master
|
2024-01-04 08:56:55 +08:00
|
|
|
PATCHES
|
|
|
|
${PATCHES}
|
|
|
|
fix_dependency.patch
|
2020-11-24 02:50:37 +08:00
|
|
|
)
|
2024-01-25 01:44:41 +08:00
|
|
|
file(REMOVE "${SOURCE_PATH}/cmake/Modules/FindLibJuice.cmake")
|
2023-12-05 09:20:43 +08:00
|
|
|
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" DATACHANNEL_STATIC_LINKAGE)
|
2023-04-19 07:38:48 +08:00
|
|
|
|
2020-11-24 02:50:37 +08:00
|
|
|
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
2021-04-10 01:01:14 +08:00
|
|
|
FEATURES
|
|
|
|
stdcall CAPI_STDCALL
|
2020-11-24 02:50:37 +08:00
|
|
|
INVERTED_FEATURES
|
2021-04-10 01:01:14 +08:00
|
|
|
ws NO_WEBSOCKET
|
|
|
|
srtp NO_MEDIA
|
2020-11-24 02:50:37 +08:00
|
|
|
)
|
|
|
|
|
2021-09-17 23:22:11 +08:00
|
|
|
vcpkg_cmake_configure(
|
2021-09-28 10:49:56 +08:00
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2020-11-24 02:50:37 +08:00
|
|
|
OPTIONS
|
|
|
|
${FEATURE_OPTIONS}
|
2023-12-05 09:20:43 +08:00
|
|
|
-DPREFER_SYSTEM_LIB=ON
|
2020-11-24 02:50:37 +08:00
|
|
|
-DNO_EXAMPLES=ON
|
|
|
|
-DNO_TESTS=ON
|
2023-12-05 09:20:43 +08:00
|
|
|
-DDATACHANNEL_STATIC_LINKAGE=${DATACHANNEL_STATIC_LINKAGE}
|
2020-11-24 02:50:37 +08:00
|
|
|
)
|
|
|
|
|
2021-09-17 23:22:11 +08:00
|
|
|
vcpkg_cmake_install()
|
2020-11-24 02:50:37 +08:00
|
|
|
|
2021-09-28 10:49:56 +08:00
|
|
|
vcpkg_cmake_config_fixup(PACKAGE_NAME LibDataChannel CONFIG_PATH lib/cmake/LibDataChannel)
|
2020-11-24 02:50:37 +08:00
|
|
|
vcpkg_fixup_pkgconfig()
|
|
|
|
|
2024-03-02 06:30:06 +08:00
|
|
|
if(srtp IN_LIST FEATURES)
|
|
|
|
set(FIND_DEP_SRTP "find_dependency(libSRTP CONFIG)")
|
|
|
|
endif()
|
|
|
|
|
2021-09-28 10:49:56 +08:00
|
|
|
file(READ "${CURRENT_PACKAGES_DIR}/share/LibDataChannel/LibDataChannelConfig.cmake" DATACHANNEL_CONFIG)
|
|
|
|
file(WRITE "${CURRENT_PACKAGES_DIR}/share/LibDataChannel/LibDataChannelConfig.cmake" "
|
2021-07-01 23:25:25 +08:00
|
|
|
include(CMakeFindDependencyMacro)
|
|
|
|
find_dependency(Threads)
|
|
|
|
find_dependency(OpenSSL)
|
2021-10-19 05:30:48 +08:00
|
|
|
find_dependency(LibJuice)
|
2024-01-04 08:56:55 +08:00
|
|
|
find_dependency(plog CONFIG)
|
2024-01-20 04:25:50 +08:00
|
|
|
find_dependency(unofficial-usrsctp CONFIG)
|
2024-03-02 06:30:06 +08:00
|
|
|
${FIND_DEP_SRTP}
|
2021-07-01 23:25:25 +08:00
|
|
|
${DATACHANNEL_CONFIG}")
|
|
|
|
|
2024-03-02 06:30:06 +08:00
|
|
|
|
2021-09-17 23:22:11 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share")
|
|
|
|
|
2023-02-10 02:46:01 +08:00
|
|
|
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
|