2024-03-16 09:38:47 +08:00
|
|
|
|
2023-01-11 05:57:50 +08:00
|
|
|
set(VCPKG_POLICY_DLLS_IN_STATIC_LIBRARY enabled)
|
2021-04-16 04:20:18 +08:00
|
|
|
|
|
|
|
vcpkg_download_distfile(ARCHIVE
|
2022-11-03 04:58:41 +08:00
|
|
|
URLS "https://www.nuget.org/api/v2/package/Microsoft.XAudio2.Redist/${VERSION}"
|
|
|
|
FILENAME "xaudio2redist.${VERSION}.zip"
|
2023-01-26 04:15:57 +08:00
|
|
|
SHA512 5eae9c94710ba6e51045e6f9dbe381bdfe76184a4272f561976582e8f585ef8343df9f6eaa2d391bfda06796000bc13ccb0f5bf112d7f2c7865f75ab0e89ab56
|
2021-04-16 04:20:18 +08:00
|
|
|
)
|
|
|
|
|
2022-06-07 03:38:56 +08:00
|
|
|
vcpkg_extract_source_archive(
|
|
|
|
PACKAGE_PATH
|
2021-04-16 04:20:18 +08:00
|
|
|
ARCHIVE ${ARCHIVE}
|
|
|
|
NO_REMOVE_ONE_LEVEL
|
|
|
|
)
|
|
|
|
|
2021-10-26 05:34:38 +08:00
|
|
|
file(GLOB HEADER_FILES "${PACKAGE_PATH}/build/native/include/*.h")
|
|
|
|
file(INSTALL ${HEADER_FILES} DESTINATION "${CURRENT_PACKAGES_DIR}/include/${PORT}")
|
2021-04-16 04:20:18 +08:00
|
|
|
|
2021-10-26 05:34:38 +08:00
|
|
|
file(INSTALL "${PACKAGE_PATH}/build/native/release/lib/${VCPKG_TARGET_ARCHITECTURE}/xaudio2_9redist.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/lib")
|
|
|
|
|
2023-01-11 05:57:50 +08:00
|
|
|
if(VCPKG_CRT_LINKAGE STREQUAL "dynamic")
|
2021-10-26 05:34:38 +08:00
|
|
|
file(INSTALL "${PACKAGE_PATH}/build/native/release/lib/${VCPKG_TARGET_ARCHITECTURE}/xapobaseredist_md.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/lib")
|
2023-01-11 05:57:50 +08:00
|
|
|
set(lib_suffix "_md")
|
2021-10-26 05:34:38 +08:00
|
|
|
else()
|
|
|
|
file(INSTALL "${PACKAGE_PATH}/build/native/release/lib/${VCPKG_TARGET_ARCHITECTURE}/xapobaseredist.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/lib")
|
2023-01-11 05:57:50 +08:00
|
|
|
set(lib_suffix "")
|
2021-10-26 05:34:38 +08:00
|
|
|
endif()
|
2021-04-16 04:20:18 +08:00
|
|
|
|
2024-03-16 09:38:47 +08:00
|
|
|
file(INSTALL "${PACKAGE_PATH}/build/native/release/bin/${VCPKG_TARGET_ARCHITECTURE}/xaudio2_9redist.dll" DESTINATION "${CURRENT_PACKAGES_DIR}/bin")
|
|
|
|
|
|
|
|
if(NOT DEFINED VCPKG_BUILD_TYPE)
|
|
|
|
file(INSTALL "${PACKAGE_PATH}/build/native/debug/lib/${VCPKG_TARGET_ARCHITECTURE}/xaudio2_9redist.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib")
|
|
|
|
|
|
|
|
if(VCPKG_CRT_LINKAGE STREQUAL "dynamic")
|
|
|
|
file(INSTALL "${PACKAGE_PATH}/build/native/debug/lib/${VCPKG_TARGET_ARCHITECTURE}/xapobaseredist_md.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib")
|
|
|
|
else()
|
|
|
|
file(INSTALL "${PACKAGE_PATH}/build/native/debug/lib/${VCPKG_TARGET_ARCHITECTURE}/xapobaseredist.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
file(INSTALL "${PACKAGE_PATH}/build/native/debug/bin/${VCPKG_TARGET_ARCHITECTURE}/xaudio2_9redist.dll" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/bin")
|
|
|
|
endif()
|
2021-04-16 04:20:18 +08:00
|
|
|
|
2024-03-16 09:38:47 +08:00
|
|
|
configure_file("${CMAKE_CURRENT_LIST_DIR}/xaudio2redist-config.cmake.in"
|
|
|
|
"${CURRENT_PACKAGES_DIR}/share/${PORT}/${PORT}-config.cmake"
|
|
|
|
@ONLY)
|
2021-04-16 04:20:18 +08:00
|
|
|
|
2024-03-16 09:38:47 +08:00
|
|
|
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
|
|
|
vcpkg_install_copyright(FILE_LIST "${PACKAGE_PATH}/LICENSE.txt")
|